Material List (RW Section)
|RW Stream Section|
Material List is a container section used in DFF files as child of a geometry section. The section itself does not store any data at all. All additional information get stored inside a struct section which directly follows this one as a child. Material List stores the different materials used by the geometry section it is appended to.
The structure stores the number of materials and material instances inside the list.
4b - DWORD - Number of materials, including material instances Xb - DWORD - Array of material indices.
A material index equals -1 if it is a material. If the material is an instance of a previously defined material, the index equals the base materials one.
As an example, the definition of a material list with two different materials would look like this:
000 2 // There are two materials in the list. 004 -1 // First material (always -1, since there needs to be at least one base material). 008 -1 // A second material.
If there is a material instance, it will store the index of the parent material:
000 4 // There are four materials in the list. 004 -1 // First material (always -1, since there needs to be at least one base material). 008 -1 // A second material. 00C 0 // Instance of the first material. 010 1 // Instance of the second material.
Note that it is not possible to create material instances in a forward declarative manner:
000 3 // There are three materials in the list. 004 -1 // First material (always -1, since there needs to be at least one base material). 008 1 // Instance of the second material defined below (error!). 00C -1 // Second material
Thus it is a good practice to store base materials before material instances:
000 4 // There are four materials in the list. 004 -1 // First material (always -1, since there needs to be at least one base material). 008 -1 // Second material 00C 0 // First instance 010 1 // Second instance (...)
Limitations of material instancing
Unlike later shader-based implementations in other game engines, material instances in Renderware are do not support manipulation of (even basic) material parameters, like phong parameters (e.g. specular, ambient and diffuse colors). They are more like implicit copies of a material and therefor may also be called material references.
As stated above, the number of child sections is equal to number of materials (excluding material instances) in the list.
|Grand Theft Auto: Vice City|
|File Formats||.adf • .b • .col • .cfg • .dff • .dat • .gxt • .ide • .ifp • .img/.dir • .ipl • .raw/.sdt • .rep • .set • .scm • .txd|
|Documentation||Audio • Handling • Map Listing • Opcodes • RenderWare • Script Paths • Saves • Sound Effects • Statistics • Vehicles • Weapons|
|Tools||CLEO • Collision File Editor II • G-Tools • GXT Editor • IMG Tool • Limit Adjuster • KEd (map editor) • Sanny Builder • TXD Workshop • Magic.TXD|
|Tutorials||How to create a mission • How to create a script • Vehicle Mod Installation|