Difference between revisions of "Material List (RW Section)"

From GTAMods Wiki
Jump to navigation Jump to search
m (Fixed a link)
Line 1: Line 1:
{{RW Section|Material List|0x0008}}
+
{{RW Section
 +
| NAME = Material List
 +
| VENDORNAME = Criterion Games
 +
| MODULENAME = Core
 +
| MODULEID = 000000
 +
| IDENTIFIER = 08
 +
| PARENTS = [[Geometry (RW Section)|Geometry]]
 +
| CHILDREN = [[Struct (RW Section)|Struct]], [[Material (RW Section)|Material]]
 +
}}
  
 
'''Material List''' is a container section used in [[model file|DFF files]] as child of a [[Geometry (RW Section)|geometry section]]. The section itself does not store any data at all. All additional information get stored inside a [[Struct (RW Section)|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.
 
'''Material List''' is a container section used in [[model file|DFF files]] as child of a [[Geometry (RW Section)|geometry section]]. The section itself does not store any data at all. All additional information get stored inside a [[Struct (RW Section)|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.
 
 
 
  
 
== Structure ==
 
== Structure ==
Line 51: Line 56:
 
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''.
 
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''.
  
== Child sections ==
+
== See also ==
  
As stated [[Material List (RW Section)#Examples|above]], the number of child sections is equal to number of materials (excluding material instances) in the list.
 
 
* [[Material (RW Section)|Material]]
 
 
== See also ==
 
 
* [[Geometry (RW Section)|Geometry]]
 
* [[Geometry (RW Section)|Geometry]]
* [[RenderWare_binary_stream_file|RW file format specification]]
 
  
{{N|SA|VC}}
+
{{N|SA|VC|3}}
[[Category:GTA_3]]
 

Revision as of 11:41, 11 September 2020

Material List
RenderWare Stream Section
Vendor Criterion Games
Module Core
Module ID 0x000000
Identifier 0x08
Chunk ID 0x00000008
Versions All
Hierarchy
Parents:
Geometry
Children:
Struct, Material
Extensions:
None
File Format

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.

Structure

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.

Examples

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.

See also