Surface Shader Lab

What's Happening

"Surface shaders" describe the appearance of surfaces and how they react to the scene lights. If you have used WTStudio, you may know them as Materials. If not, think of them as "super-textures" that let you define multiple layers and effects such as shifters and reflection mapping.

Surface shaders are applied to models and actors just like bitmaps - use the setSurfaceShader() method. In fact, this method will override any previous setTexture() calls.

The purpose of this lab is to let you play with a surface shader of up to three layers. You can pick from a selection of models and spin them around by dragging the mouse. Click on the thumbnails to select new bitmaps and use the controls to play with different layer properties. The "Preset" buttons will give you a good place to start.

Keep in mind that the first, second, and third layers are named layer 0, layer 1, and layer 2, respectively.

Key Methods Used

WT::createSurfaceShader, WTSurfaceShader::setGeometryDiffuseColor, WTSurfaceShader::setGeometrySpecularColor, WTSurfaceShader::setGeometrySpecularPower, WTSurfaceShader::setGeometrySpecularOverride, WTSurfaceShader::setTexture, WTSurfaceShader::setNumLayers, WTSurfaceShader::setLayerSource, WTSurfaceShader::setLayerType, WTSurfaceShader::setProceduralWithString, WTSurfaceShader::setTextureCoordGenMethod, WTSurfaceShader::setTextureCoordScales

Points to Remember