Material is an abstract concept which has been developed to replace the id Tech 1 mechanism of directly associating flat, texture, etc…, texture resources to the map geometry surfaces on which they are to be drawn.
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.
During game initialization, the engine dynamically constructs materials for each texture resource. These automatically generated materials are named accordingly to the texture resources they abstract. This creates a name binding where instances of texture resource names are instead interpreted as material URIs. Material names are populated into a indexing scheme specific to the type of texture resource which bore it's name. These scheme names may be used to resolve ambiguous cases where name bindings exist in multiple schemes.
In addition to automatic generation, new materials may be defined in add-ons using material definitions. 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
MaterialBind. Material URIs, GUIDs and pointers are publicly visible entities (utility routines for resolving and translating between material references are available via the Doomsday Public API).
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.