User Tools

Site Tools


modding:material

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
modding:material [2013-01-09 07:27]
danij
modding:material [2013-01-09 07:28] (current)
danij /* See also */
Line 1: Line 1:
 +//​Material//​ is an abstract concept which has been developed to replace the [[id_tech_1|id Tech 1]] mechanism of directly associating [[flat]], [[texture]],​ etc..., texture resources to the [[map]] geometry surfaces on which they are to be drawn.
 +
 +
 +====== 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,​ 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 [[resource_uris|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 [[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 ''​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.
 +
 +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]]
 +
 +
 +
  
modding/material.txt ยท Last modified: 2013-01-09 07:28 by danij