Torque Shader Engine DocumentationCVS Revision Label 0.1.x |
Table of Contents
A material in TSE is a data structure that descibes a surface. It contains many different types of information such as sound, physics and rendering properties. At this early release of the TSE, most of the information in materials focuses on rendering.
The TSE generates shaders from Material definitions. The shaders are compiled at runtime and output into the example/shaders directory. Any errors or warnings generated from compiling the procedurally generated shaders are output to the console as well as the output window in the Visual C IDE. If a Material shader fails to compile, notify GarageGames at tsesupport@garagegames.com. Make sure to include the Material definition, and follow bug submission best practices.
There are many different rendering properties that can be defined in materials and most of them are specific to a particular material stage. Each stage is essentially a different pass that is rendered on a surface. Stages are indicated by the array index of the material parameter. See the example Materials at the end of this chaper. Stages are useful for multi-layer effects.
For instance, if you wanted a special effect where one layer would scroll in one direction and another would scroll on top of it in another direction and they are blended together, stages would be the way to do it.
Another example would be if you wanted the specular component of a material to glow, but not the rest of the material, then you could specify a second stage that had specular and glow on it. The second stage would then be additively blended on top of the first.