"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

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


XML Node Summary
<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>

Description
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)

Attributes
  • 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

Code sample :

<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>

Description
Sets the material ambient lighting reflexion coefficients.

ambient element has 4 attributes and 0 sub-element(s)

Attributes
  • 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>

Description
Sets the material diffuse lighting reflexion coefficients.

diffuse element has 4 attributes and 0 sub-element(s)

Attributes
  • 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>

Description
Sets the material specular lighting reflexion coefficients.

specular element has 5 attributes and 0 sub-element(s)

Attributes
  • 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>

Description
Sets the material emissive color.

emissive element has 4 attributes and 0 sub-element(s)

Attributes
  • 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>

Description
Adds a texture.

add_texture element has 2 attributes and 0 sub-element(s)

Attributes
  • name [STRING]: texture name
  • unit [INTEGER]: texture unit - Values = [0 ; 7]
Random Projects

Thermal Vision PostFX
Thermal Vision PostFX

Lens Circle Effect
Lens Circle Effect

Depth Buffer Visualization
Depth Buffer Visualization


Random Code Samples

Built-in Meshes
Built-in Meshes

OpenCTM Format Loading
OpenCTM Format Loading

Render to texture
Render to texture



(C)2009-2010 Geeks3D.com