Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
material [2011-12-24 20:35] – danij | material [2013-01-09 05:28] (current) – /* See also */ danij | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | // | ||
+ | |||
+ | |||
+ | ====== Overview ====== | ||
+ | |||
+ | Material abstracts the relationship between texture resource and the surfaces on which they are drawn, by adding two additional levels of indirection. These additional levels serve to isolate texture resources behind the name(s) by which they are referenced, both internally within the engine and publicly, via the [[dmu]] API. | ||
+ | |||
+ | |||
+ | ====== Detailed ====== | ||
+ | |||
+ | During game initialization, | ||
+ | |||
+ | In addition to automatic generation, new materials may be defined in add-ons using [[ded_material|material definition]]s. Definitions can also be used to modify the auto-generated materials. | ||
+ | |||
+ | Any time a texture resource is referenced by name at runtime, the name is instead interpreted as a material resource URI. Each known material name is associated with a unique '' | ||
+ | |||
+ | When drawing, the texture(s) to be used are then resolved (by the engine) from the mappings within the material. This includes any additional effects that are associated to the name-bound material. | ||
+ | |||
+ | Notes: | ||
+ | * A single texture resource may be bound to many materials, however the material name must be unique in it's resource scheme. | ||
+ | * Materials are eternal and name bindings persist after runtime engine resets (no need to update the name bindings). | ||
+ | * All instances where the original texture resource names are used are now interpreted as material names (for example, associations with named texture resources in [[ded]]s and scripts). | ||
+ | |||
+ | |||
+ | ====== Features ====== | ||
+ | |||
+ | * Any texture resource type can be used in any draw situation (e.g., [[flat]]s on walls, [[sprite]]s on floors, etc...). | ||
+ | * Material animations are not limited to sequences of the same type of texture resources (e.g., animating from texture to flat), with optional [[rend-tex-anim-smooth|smoothing]]. | ||
+ | |||
+ | |||
+ | ====== See also ====== | ||
+ | |||
+ | * [[ded_material|Material Definition]] | ||
+ | * [[resource_uris]] | ||
+ | |||
+ | |||
+ | |||