![]() |
VR-Vantage 2.2 API Documentation
|
This example shows how to create a custom post processor for VR Vantage.
The example creates two derived classes. ExamplePostProcessor derives from DtPostProcessor and implements the constructor and update function for the new custom post processor. The class ExamplePostProcessorCreator is derived from DtPostProcessorCreator and is utilized in the DtPostProcessorFactory.
The plugin's init function sets the order of the post processor (placed before "camera_fx" runs) and registers the post processor effect with a user defined ObserverSetting enumeration value.
The update function demonstrates how to retrieve the depth buffer from the render to texture camera and link it to the shader state for the post processor. It also shows how to send variables such as time to the shader.
The shader for the post procesor is in examples\examplePostProcessor\example_ps.glsl. It draws the depth buffer in the lower left corner of the screen and applies a since wave distortion on the render to texture camera color buffer.
Please see the comments in the code as well since it describes the post processing system.
To build the plugin, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.
This example is a plug-in. You can run it by running ./bin/examplePostProcessor_stealth.bat(on Windows) or ./bin/examplePostProcessor_stealth.sh (on Linux). For more information about running examples, please see Running Applications and Examples.