DtVreOsgEffectTextureController manages texture swapping effects in the OSG rendering pipeline. Based on VR-Vantage's exampleEffectTexturePlugin, it provides the ability to dynamically apply shader-based effects to textures during rendering. This enables features like map overlays, HUD elements, and other specialized visual effects.
#include <vreOsgEffectTextureController.h>
|
| | DtVreOsgEffectTextureController (makVrv::DtDe &de, int effectTextureType, const std::string &typeString, const std::string &postfix, const std::string &fragFilename, const std::string &vertFilename, const std::string &fragFunction, const std::string &vertFunction, const std::string &effectUnitName, const std::string &indirectTextureMapName, const std::string &indirectTextureCoordName) |
| |
| virtual | ~DtVreOsgEffectTextureController () override |
| |
| virtual bool | installShaders (int baseUnit, int effectUnit, const osg::Texture *tex, osg::StateSet *stateSet, const std::string &baseTextureName) const override |
| |
◆ DtVreOsgEffectTextureController()
| makVre::DtVreOsgEffectTextureController::DtVreOsgEffectTextureController |
( |
makVrv::DtDe & | de, |
|
|
int | effectTextureType, |
|
|
const std::string & | typeString, |
|
|
const std::string & | postfix, |
|
|
const std::string & | fragFilename, |
|
|
const std::string & | vertFilename, |
|
|
const std::string & | fragFunction, |
|
|
const std::string & | vertFunction, |
|
|
const std::string & | effectUnitName, |
|
|
const std::string & | indirectTextureMapName, |
|
|
const std::string & | indirectTextureCoordName ) |
Constructor.
- Parameters
-
| de | Reference to the display engine |
| effectTextureType | Type identifier for this effect texture |
| typeString | String identifier for this effect type |
| postfix | Suffix for shader uniform names |
| fragFilename | Filename of the fragment shader |
| vertFilename | Filename of the vertex shader |
| fragFunction | Name of the fragment shader function to call |
| vertFunction | Name of the vertex shader function to call |
| effectUnitName | Name of the texture unit for the effect |
| indirectTextureMapName | Name of the indirect texture map |
| indirectTextureCoordName | Name of the indirect texture coordinates |
Creates a new effect texture controller with the specified parameters. These parameters define the shaders, texture units, and naming conventions used by this effect controller.
References de().
◆ ~DtVreOsgEffectTextureController()
| virtual makVre::DtVreOsgEffectTextureController::~DtVreOsgEffectTextureController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of effect texture controller resources.
◆ installShaders()
| virtual bool makVre::DtVreOsgEffectTextureController::installShaders |
( |
int | baseUnit, |
|
|
int | effectUnit, |
|
|
const osg::Texture * | tex, |
|
|
osg::StateSet * | stateSet, |
|
|
const std::string & | baseTextureName ) const |
|
overridevirtual |
Installs the effect shaders into a state set.
- Parameters
-
| baseUnit | Base texture unit index |
| effectUnit | Effect texture unit index |
| tex | Pointer to the effect texture |
| stateSet | State set to install the shaders into |
| baseTextureName | Name of the base texture sampler |
- Returns
- True if shaders were installed successfully, false otherwise
Installs the effect shaders into the provided state set, configuring the necessary uniforms and texture units for the effect. This is called during the rendering process to apply the effect to the specified texture.
◆ getEffectsEnabledUniform()
| static osg::ref_ptr< osg::Uniform > makVre::DtVreOsgEffectTextureController::getEffectsEnabledUniform |
( |
| ) |
|
|
static |
Gets the uniform used for toggling effect textures.
- Returns
- Reference-counted pointer to the effects enabled uniform
Returns the uniform that controls whether effect textures are enabled. This can be used to globally toggle all effects of this type on or off.
◆ myFragShader
| std::string makVre::DtVreOsgEffectTextureController::myFragShader |
|
private |
Path to the fragment shader file.
◆ myVertShader
| std::string makVre::DtVreOsgEffectTextureController::myVertShader |
|
private |
Path to the vertex shader file.
◆ myFragFunction
| std::string makVre::DtVreOsgEffectTextureController::myFragFunction |
|
private |
Name of the fragment shader function to call.
◆ myVertFunction
| std::string makVre::DtVreOsgEffectTextureController::myVertFunction |
|
private |
Name of the vertex shader function to call.
◆ myEffectUnitName
| std::string makVre::DtVreOsgEffectTextureController::myEffectUnitName |
|
private |
Name of the texture unit for the effect.
◆ effectsEnabledUniform
| osg::ref_ptr<osg::Uniform> makVre::DtVreOsgEffectTextureController::effectsEnabledUniform |
|
staticprivate |
Shared uniform for enabling/disabling all effect textures.
The documentation for this class was generated from the following file: