Difference between revisions of "RpMaterial"

From GTAMods Wiki
Jump to navigation Jump to search
m (The hero moved page Material (RW Section) to RpMaterial: Restructuring RW pages to be less stream-oriented)
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RW Section|Material|0x0007}}
+
{{RW Section
 +
| NAME = Material
 +
| VENDORNAME = Criterion Games
 +
| MODULENAME = Core
 +
| MODULEID = 000000
 +
| IDENTIFIER = 07
 +
| PARENTS = [[Material List (RW Section)|Material List]]
 +
| CHILDREN = [[Struct (RW Section)|Struct]], [[Texture (RW Section)|Texture]]
 +
| EXTENSIONS = [[Right To Render (RW Section)|Right To Render]], [[User Data PLG (RW Section)|User Data PLG]], [[Material Effects PLG (RW Section)|Material Effects PLG]], [[UV Animation PLG (RW Section)|UV Animation PLG]], [[Reflection Material (RW Section)|Reflection Material]], [[Specular Material (RW Section)|Specular Material]]
 +
}}
  
 
'''RpMaterial''' is a [[RenderWare]] structure that stores geometric data for 3D geometry.
 
'''RpMaterial''' is a [[RenderWare]] structure that stores geometric data for 3D geometry.
  
== Stream Structure ==
+
== Structure ==
  
 
When streamed in/out it is usually the child of a [[Material List (RW Section)|Material List]] chunk and parent of a [[Struct (RW Section)|Struct]], optional [[Texture (RW Section)|Texture]] and [[Extension (RW Section)|Extension]] chunk.
 
When streamed in/out it is usually the child of a [[Material List (RW Section)|Material List]] chunk and parent of a [[Struct (RW Section)|Struct]], optional [[Texture (RW Section)|Texture]] and [[Extension (RW Section)|Extension]] chunk.
Line 22: Line 31:
 
If the material is defined as textured above, a [[Texture (RW Section)|Texture]] chunk will follow the Struct.
 
If the material is defined as textured above, a [[Texture (RW Section)|Texture]] chunk will follow the Struct.
  
=== Extension ===
+
== See also ==
 
 
The extension of an material can hold the following chunks in GTA:
 
 
 
* [[Right To Render (RW Section)|Right To Render]]
 
* [[Material Effects PLG (RW Section)|Material Effects PLG]]
 
* [[UV Animation PLG (RW Section)|UV Animation PLG]]
 
* [[Reflection Material (RW Section)|Reflection Material]]
 
* [[Specular Material (RW Section)|Specular Material]]
 
  
== See also ==
 
 
* [[Geometry List (RW Section)|Geometry List]]
 
* [[Geometry List (RW Section)|Geometry List]]
* [[RenderWare_binary_stream_file|RW file format specification]]
 
  
{{N|SA|VC}}
+
{{N|SA|VC|3}}
[[Category:GTA_3]]
 

Latest revision as of 10:57, 14 September 2020

Material
RenderWare Stream Section
Vendor Criterion Games
Module Core
Module ID 0x000000
Identifier 0x07
Chunk ID 0x00000007
Versions All
Hierarchy
Parents:
Material List
Children:
Struct, Texture
Extensions:
Right To Render, User Data PLG, Material Effects PLG, UV Animation PLG, Reflection Material, Specular Material
File Format

RpMaterial is a RenderWare structure that stores geometric data for 3D geometry.

Structure

When streamed in/out it is usually the child of a Material List chunk and parent of a Struct, optional Texture and Extension chunk.

The format of the Material's Struct chunk is as follows:

int32        flags (unused)
RwRGBA       color    (RwRGBA: uint8 r, g, b, a)
int32        unused
bool32       isTextured
#if version > 0x30400
  surface properties:
    float32  ambient
    float32  specular
    float32  diffuse
#endif

If the material is defined as textured above, a Texture chunk will follow the Struct.

See also