[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<material> XML Node
<material
name=""
render=""
texturing=""
specular_exp="16.0"
opacity="1.0"
shader_program=""
shader_program_ambient_pass=""
preset="USER"
>
<ambient
r="0.9"
g="0.9"
b="0.9"
a="1.0"
>
</ambient>
<diffuse
r="0.9"
g="0.9"
b="0.9"
a="1.0"
>
</diffuse>
<specular
r="0.6"
g="0.6"
b="0.6"
a="1.0"
exp="16.0"
>
</specular>
<emissive
r="0.0"
g="0.0"
b="0.0"
a="0.0"
>
</emissive>
<add_texture
name=""
unit=""
>
</add_texture>
</material>
<material>
The fundamental goal of material is to define the final appearence of an object surface. A material has light reflection coefficients, textures and GPU shaders
that contribute to the final pixel color. All renderable objects have a material that is used (applied to the renderer) when the object is rendered.
material element has 8 attributes and 5 sub-element(s)
- name [STRING]: Name of the material object
- render [BOOLEAN]: Sets the render state of the material. If the render state if set to FALSE, all objects that use this material will not be rendered.
- texturing [BOOLEAN]: Enables or disables texture mapping for all objects that use this material.
- specular_exp [REAL]: Material shininess factor. - Default value = 16.0
- opacity [REAL]: Material's opacity. 1.0 means a fully opaque material and 0.0 means a fully transparent material. - Default value = 1.0 - Values = [0.0 ; 1.0]
- shader_program [STRING]: The GPU shader program to be attached to this material.
- shader_program_ambient_pass [STRING]: The GPU shader program for shadow ambient pass to be attached to this material.
- preset [STRING]: Specifies a preset (built-in set of reflexion coefficents). - Default value = USER - Values = GOLD | BLACK_PLASTIC | CHROME | BRASS | BRONZE | SILVER | POLISHED_SILVER | COPPER | PEWTER | JADE | RUBY | PEARL | EMERALD
:
<material name="mat01" shader_program="" >
<ambient r="0.4" g="0.4" b="0.4" a="1.0" />
<diffuse r="0.8" g="0.8" b="0.6" a="1.0" />
<specular r="0.6" g="0.6" b="0.6" a="1.0" exp="24.0" />
<add_texture name="" unit="0" />
</material>
<ambient>
Sets the material ambient lighting reflexion coefficients.
ambient element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.9
- g [REAL]: green channel - Default value = 0.9
- b [REAL]: blue channel - Default value = 0.9
- a [REAL]: alpha channel - Default value = 1.0
<diffuse>
Sets the material diffuse lighting reflexion coefficients.
diffuse element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.9
- g [REAL]: green channel - Default value = 0.9
- b [REAL]: blue channel - Default value = 0.9
- a [REAL]: alpha channel - Default value = 1.0
<specular>
Sets the material specular lighting reflexion coefficients.
specular element has 5 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.6
- g [REAL]: green channel - Default value = 0.6
- b [REAL]: blue channel - Default value = 0.6
- a [REAL]: alpha channel - Default value = 1.0
- exp [REAL]: shininess - Default value = 16.0
<emissive>
Sets the material emissive color.
emissive element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.0
- g [REAL]: green channel - Default value = 0.0
- b [REAL]: blue channel - Default value = 0.0
- a [REAL]: alpha channel - Default value = 0.0
<add_texture>
Adds a texture.
add_texture element has 2 attributes and 0 sub-element(s)
- name [STRING]: texture name
- unit [INTEGER]: texture unit - Values = [0 ; 7]
|