![]() |
VR-Vantage 2.2 API Documentation
|
VR-Vantage has a concept of Effect Textures.
These effect textures allow you to have additional textures on a model without needing to edit the actual model file. This is how normal maps, emissivity maps, or any other secondary textures are configured in VR-Vantage. See section 24.7 of the VR-Vantage Users Guide for an explaination of the effect textures that are currently supported.
This example shows how to create a custom effect texture type and configure it to be applied to any model that has specially named textures.
The class DtExampleEffectTextureController is the main class to look at for this example. The constructor sets up the vertex and fragment shaders that will be used when an EET texture is loaded. The generateShaders() function sets up the final version of the shader text and loads the shaders as virtual program functions (see exampleCustomShader for an explaination about how virtual programs work). getEffectTypeCode() specifies which texture Postfix should be used to determine if this effect texture controller should be used.
This example is a plug-in. You can run it by running ./bin/exampleEffectTexturePlugin_stealth.bat (on Windows) or ./bin/exampleEffectTexturePlugin_stealth.sh (on Linux). For more information about running examples, please see Running Applications and Examples. Close the open Terrain dialog to see the Helicopter that is loaded by the example.
The script that runs the example will also create the EET texture used by the example.
When running the example push the T key to turn the effect on or off. Notice the camo on the helicopter switch from blue to brown when the effect texture is toggled.