5.32. Material (material)

<material> ‐ Material properties

5.32.1. Attributes

NameTypeDefaults
idIDNone (required)

5.32.2. Description

This element defines material properties for OpenGL or Renderman. In these lighting models, colors have four components: the ambient, diffuse, and specular colors, the shininess, and the color of any emitted light. All the colors are defaulted to opaque black (0.0, 0.0, 0.0, 1.0) and the shininess is defaulted to 0.0.

The element material can have five elements in its scope that define the four color components and the shininess: ambient, diffuse, specular, emission, and shininess. The first four elements are characterized by the values of their float attributes r (red), g (green), b (blue), and a (alpha) for transparency. The element shininess has only one attribute s.

Material properties and textures can be blended if the env_mode attribute of the texture is equal to blend_fragment.

5.32.3. Expected children

The following elements can occur in material: ambient, diffuse, specular, emission, and shininess.

5.32.4. Example

The example below defines a shiny gold material that has no emitted light.

<material id="gold">
  <ambient r="0.24725" g="0.19950" b="0.07450" a="1.0"/>
  <diffuse r="0.75164" g="0.60648" b="0.22648" a="1.0"/>
  <specular r="0.62828" g="0.55580" b="0.36607.50827" a="1.0"/>
  <emission r="0.0" g="0.0" b="0.0" a="1.0"/>
  <shininess s="51.2"/>
</material>