Building a custom material
Torque 3D's material system allows us to build nearly any type of rendered surface for our 3D objects. The appropriate shaders are automatically generated by Torque 3D based on the Material
class properties we set. However, there are times when we need to do something special for our game that the standard material system cannot handle. In those circumstances, the
CustomMaterial
class allows us to use custom shaders with our objects. While a discussion on writing HLSL code to produce shaders is beyond the scope of this book, this recipe demonstrates how to hook up custom vertex and pixel shaders into Torque 3D's rendering pipeline.
Getting ready
We will be making TorqueScript changes in a project based on the Torque 3D Full
template, and try them out using the Empty Terrain
level. If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the Full
template. It will be found under the My Projects
directory. Then start...