next up previous contents index
Next: Generic Texture Example Up: Texture Previous: Cylindrical Mapping

Defining your own textures

     Texture objects are called when an object's colour is being determined. They are given a chance to modify an object's material properties before the colour of a ray is determined. They can also modify the surface normal of the ray's hit point. This changes the way lighting affects the object.

The Texture class is an abstract class which has a few built in subclasses and you can also create your own subclasses. The syntax for creating a Texture is complex, but it allows a huge amount of flexibility.

A texture subclass requires a constructor which sets up the variables required for the texture and a function apply which defines how the texture changes the object.

The texture syntax is best described by example. Section 10.2.1 explains how to write a texture class. Section 10.2.2 shows how to create a simple colour varying texture. The colour is dependent on the position on the object.





Sophie Day
Fri Feb 20 15:47:19 NZDT 1998