Torque Shader EngineTorque Shader Engine Documentation
CVS Revision Label 0.1.x

Material Instances

Materials can be placed on any type of surface in the TGE. Since different types of surfaces have different underlying geometry and lighting data, they need to generate different types of shaders even though the Material may be the same. The mapping of a material to different types of geometry is handled through a material instance (MatInstance).

MatInstances take information from the Material, the scenegraph, the surface, and the target hardware and filter it down into shader passes before sending it off to the shader generation module. They also store pointers to the shaders created and use them later when the TSE sets up render states for the material.