Computer Graphics

File Format for Defining a Material

The material properties for an object determines how the object reflects light, and therefore its perceived colour.

In this implementation an object as a whole can have a material property, and each individual face of the object may have a material. If a face does not have a material then it inherits the material of the object. If the object is not given a material, then it inherits a default material.

Note that setting the material for each face of an object considerably slows OpenGL rendering.

A material specification has the following components:

If the previous entry is 1, then it is followed by:

For example,

1
0 
1 0.2 0.2 0.2 1.0
1 0.9 0.1 0.1 1.0
0
0

means: