Game Development Reference
In-Depth Information
number of tags; the ones we will examine are MATERIAL_NAME,
MATERIAL_CLASS, MATERIAL_AMBIENT, MATERIAL_DIFFUSE,
MATERIAL_SPECULAR, MATERIAL_SHINE, MATERIAL_SHINE-
STRENGTH, MATERIAL_TRANSPARENCY, MATERIALS_WIRESIZE,
MATERIAL_SELFILLUM, MAP_DIFFUSE, NUMSUBMTLS and SUB-
MATERIAL. MATERIAL_NAME is self-explanatory. MATERIAL_CLASS
indicates whether this material contains sub-materials or not. A value of
'Multi/Sub-Object' indicates sub-materials will be present, whilst a value of
'Standard' indicates that the material contains only the base values. When
we read the polygon list each polygon has an integer indicating which
material to use. In addition, an object is given a material integer. For a
material that contains no sub-materials, the integer defines the base
material and will be zero. For a material that contains sub-materials, the
integer defines the sub-material to use.
The material tags MATERIAL_AMBIENT, MATERIAL_DIFFUSE and
MATERIAL_SPECULAR define RGB values for the ambient, diffuse and
specular components. MATERIAL_SHINE and MATERIAL_SHINE-
STRENGTH are used along with the specular component to define the
glossiness of a surface. MATERIAL_TRANSPARENCY defines the
transparency, with 0.0 being opaque and 1.0 being totally transparent.
MATERIAL_WIRESIZE is used by the editor to indicate the wireframe line
width. MATERIAL_SELFILLUM indicates the luminance level for this
surface.
The tag MAP_DIFFUSE contains another subsection contained within
opening and closing braces. A map subsection contains a great deal of
information and we will look at this later in the chapter.
When a material contains sub-materials the total number is defined
using the NUMSUBMTLS tag. Each sub-material is defined using a
SUBMATERIAL tag containing a consecutively numbered integer starting
at zero. 3DS Max can contain an unlimited number of nested sub-
materials. When reading a sub-material the tags are the same as the base
MATERIAL.
*MATERIAL_LIST {
*MATERIAL_COUNT 1
*MATERIAL 0 {
*MATERIAL_NAME "Box"
*MATERIAL_CLASS "Multi/Sub-Object"
*MATERIAL_AMBIENT 0.1000 0.1000 0.1000
*MATERIAL_DIFFUSE 0.5000 0.5000 0.5000
*MATERIAL_SPECULAR 0.9000 0.9000 0.9000
*MATERIAL_SHINE 0.2500
Search Nedrilad ::




Custom Search