Like materials and textures, shaders control the surface appearance of models. Unlike a texture, which is simply an image file stretched or tiled across an object, a shader gives your objects descriptive properties like shadowing or reflectivity.
Shaders are real-time shading plugins, altering the appearance of models in the scene. With Open Reality you can add new shaders to MotionBuilder.
To build the samples cgshader and cgshaderfractal you need the Cg header files and libraries provided by the Cg Toolkit 3.0. The DLLs are provided in the MotionBuilder bin folder, or they can be downloaded from NVIDIA.
The project files will need to be modified to reflect the location of the headers and library files. For the linker step you will also need to add cg.lib and cgGL.lib as additional dependencies under the input tab.
These samples run only on Windows, not Mac OSX.
To see a shader:
Simple Cg vertex shader. Requires Cg Toolkit 3.0.
More complex Cg shader.A pixel shader that uses the Mandelbrot set fractals. Requires Cg Toolkit 3.0.
Simple template for creating new shaders. It is a simple lit shader, the same as the default shader used in the software.
Draws triangles at model vertices. Draws triangles in screen coordinates at model vertices.
Simple texture material shader that applies textures and materials with OpenGL.