VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtShaderEffectSnow Class Reference

DtShaderEffectSnow injects custom shaders into the scene, Handles snow on the ground causing the ground to look covered by snow. Also adds an effect to road areas which show snow blowing over the road.

Inheritance diagram for makVrv::DtShaderEffectSnow:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtShaderEffectSnow ()
 
 DtShaderEffectSnow (DtDe &de)
 
 DtShaderEffectSnow ()=delete
 
 DtShaderEffectSnow (const DtShaderEffectSnow &)=delete
 
DtShaderEffectSnow & operator= (const DtShaderEffectSnow &)=delete
 
virtual void initializeEffect (const std::vector< osg::StateSet * > &statesets) override
 
virtual void releaseGLObjects (osg::State *state) override
 
virtual void registerWeatherEffectsObject (DtOsgWeatherEffectsObject *weatherEffectsObject) override
 
virtual void updateImGui () override
 
virtual void updateStateAndUniforms () override
 
virtual bool isEnabled () const override
 
virtual void setCameraLocation (const DtVector &location) override
 
virtual const DtVector & cameraLocation () const
 
- Public Member Functions inherited from makVrv::DtShaderEffect
virtual ~DtShaderEffect ()
 
 DtShaderEffect ()=delete
 
 DtShaderEffect (const DtShaderEffect &)=delete
 
DtShaderEffect & operator= (const DtShaderEffect &)=delete
 
virtual void updateTextureUniforms ()
 
virtual void setWindSpeed (float speed)
 
virtual void setWindDirection (float direction)
 
virtual void setEffectDirty (bool dirty)
 
virtual bool effectDirty ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static const std::string & theClassName ()
 

Protected Member Functions

virtual void installShader (const std::vector< osg::StateSet * > &stateSets)
 
virtual void uninstallShader (const std::vector< osg::StateSet * > &stateSets)
 
virtual void updateEnabledState ()
 
virtual void updateWindUniform ()
 
virtual void updateLocalizedWind (const DtVector &location)
 
virtual void slot_snowAccumulationChanged (double depth)
 
virtual void slot_snowRoadAccumulationChanged (double depth)
 
virtual void slot_snowMinimumElevationChanged (double elevation)
 
virtual void slot_snowElevationTransitionChanged (double elevation)
 
virtual void slot_PreObserverUpdate (double simTime)
 
- Protected Member Functions inherited from makVrv::DtShaderEffect
 DtShaderEffect (DtDe &de)
 
virtual int loadShaderEffectTexture (const std::string &filename, const std::string &uniformName)
 
virtual int addShaderEffectTexture (osg::Texture *shaderEffectTexture, const DtIndirectTexturePrototype *vrvTexture, const std::string &uniformName)
 

Protected Attributes

DtSignalConnectionManager myConnections
 
osg::ref_ptr< osg::Uniform > myEnableSnowUniform
 
osg::ref_ptr< osg::Uniform > mySnowUpThresholdUniform
 
osg::ref_ptr< osg::Uniform > mySnowColorUniform
 
osg::ref_ptr< osg::Uniform > mySnowMaskedRoadUniform
 
osg::ref_ptr< osg::Uniform > mySnowWindUniform
 
osg::ref_ptr< osg::Uniform > mySnowPolyMaskUniform
 
GLuint mySnowEffectTextureId
 
GLuint64 mySnowEffectImageHandle
 
osg::ref_ptr< osg::Texture2D > mySnowEffectTexture
 
const DtIndirectTexturePrototype * mySnowEffectVrvTexture = nullptr
 
DtIndirectGlTextureObject * mySnowEffectTextureBindless = nullptr
 
bool mySnowEnabled
 
bool myImGuiSnowEnabled
 
float mySnowUpThresholdRange
 
float mySnowUpThresholdMin
 
float mySnowElevationMin
 
float mySnowElevationRange
 
float mySnowMaskedRoadMax
 
float mySnowMaskedRoadRange
 
bool myEnableBlowingSnow
 
osg::Vec4 mySnowColor
 
float myWindSpeedMps
 
float myWindDirectionRad
 
float myWindOffset
 
double myLastSimulationTime
 
DtVector myCameraLocation
 
double myCameraAltitude
 
DtOsgWeatherEffectsObject * myWeatherEffectsObject
 
- Protected Attributes inherited from makVrv::DtShaderEffect
DtDe & myDe
 
TextureDataPtrVector myShaderEffectTextures
 
bool myEffectDirty
 
DtIndirectGlTextureObjectManager & myIndirectGlTextureObjectManager
 
DtOsgRenderer & myOsgRenderer
 

Friends

class DtSnowEffectGeneration
 

Additional Inherited Members

- Public Types inherited from makVrv::DtShaderEffect
typedef std::vector
< DtShaderEffectTextureData > 
TextureDataPtrVector
 

Constructor & Destructor Documentation

virtual makVrv::DtShaderEffectSnow::~DtShaderEffectSnow ( )
virtual

DTOR.

makVrv::DtShaderEffectSnow::DtShaderEffectSnow ( DtDe &  de)

constructor

makVrv::DtShaderEffectSnow::DtShaderEffectSnow ( )
delete

unimplemented private default constructor

makVrv::DtShaderEffectSnow::DtShaderEffectSnow ( const DtShaderEffectSnow &  )
delete

Copy Constructor not implemented – Copy not allowed.

Member Function Documentation

DtShaderEffectSnow& makVrv::DtShaderEffectSnow::operator= ( const DtShaderEffectSnow &  )
delete

Assignment Operator not implemented – Copy not allowed.

virtual void makVrv::DtShaderEffectSnow::initializeEffect ( const std::vector< osg::StateSet * > &  statesets)
overridevirtual

initializes or reinitializes the effects. Called by DtOsgRenderer at startup and whenever reload shaders is triggered reloads the shader changes if triggered from reload shaders but the texture is not reloaded off disk due to osgFileCache

Reimplemented from makVrv::DtShaderEffect.

virtual void makVrv::DtShaderEffectSnow::releaseGLObjects ( osg::State *  state)
overridevirtual

handle destruction of graphics objects when the context is destroyed

Reimplemented from makVrv::DtShaderEffect.

virtual void makVrv::DtShaderEffectSnow::registerWeatherEffectsObject ( DtOsgWeatherEffectsObject *  weatherEffectsObject)
overridevirtual

called by the DtOsgWeatherEffectsObject constructor to register itself when it is created.

Implements makVrv::DtShaderEffect.

virtual void makVrv::DtShaderEffectSnow::updateImGui ( )
overridevirtual

update the imgui widgets and readback any changes from them

Implements makVrv::DtShaderEffect.

virtual void makVrv::DtShaderEffectSnow::updateStateAndUniforms ( )
overridevirtual

Allows the effect to update the enabled/disabled state of the effects based on the current settings and weather conditions. Updates the uniforms that may need to be changed based on the imgui or regular gui inputs.

Implements makVrv::DtShaderEffect.

virtual bool makVrv::DtShaderEffectSnow::isEnabled ( ) const
overridevirtual

whether this effect is enabled or not.

Implements makVrv::DtShaderEffect.

virtual void makVrv::DtShaderEffectSnow::setCameraLocation ( const DtVector &  location)
overridevirtual

sets the location for localized effects.

Reimplemented from makVrv::DtShaderEffect.

virtual const DtVector& makVrv::DtShaderEffectSnow::cameraLocation ( ) const
virtual
static const std::string& makVrv::DtShaderEffectSnow::theClassName ( )
static

Get the name this class is registered by.

virtual void makVrv::DtShaderEffectSnow::installShader ( const std::vector< osg::StateSet * > &  stateSets)
protectedvirtual

Install the virtual program shader.

virtual void makVrv::DtShaderEffectSnow::uninstallShader ( const std::vector< osg::StateSet * > &  stateSets)
protectedvirtual

Install the virtual program shader.

virtual void makVrv::DtShaderEffectSnow::updateEnabledState ( )
protectedvirtual

Computes the current enabled state based on the current state values.

virtual void makVrv::DtShaderEffectSnow::updateWindUniform ( )
protectedvirtual

Updates the uniform related to wind. Computes the wind based on current location associated with this effect.

virtual void makVrv::DtShaderEffectSnow::updateLocalizedWind ( const DtVector &  location)
protectedvirtual

Computes and updates the current local wind data based on the given world location.

virtual void makVrv::DtShaderEffectSnow::slot_snowAccumulationChanged ( double  depth)
protectedvirtual

listen to the snow accumulation changes from the environment

virtual void makVrv::DtShaderEffectSnow::slot_snowRoadAccumulationChanged ( double  depth)
protectedvirtual

listen to the snow road accumulation changes from the environment

virtual void makVrv::DtShaderEffectSnow::slot_snowMinimumElevationChanged ( double  elevation)
protectedvirtual

listen to the snow minimum elevation changes from the environment

virtual void makVrv::DtShaderEffectSnow::slot_snowElevationTransitionChanged ( double  elevation)
protectedvirtual

listen to the snow elevation transition changes from the environment

virtual void makVrv::DtShaderEffectSnow::slot_PreObserverUpdate ( double  simTime)
protectedvirtual

handle the pre objeserver update.

Friends And Related Function Documentation

friend class DtSnowEffectGeneration
friend

Member Data Documentation

DtSignalConnectionManager makVrv::DtShaderEffectSnow::myConnections
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::myEnableSnowUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::mySnowUpThresholdUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::mySnowColorUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::mySnowMaskedRoadUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::mySnowWindUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtShaderEffectSnow::mySnowPolyMaskUniform
protected
GLuint makVrv::DtShaderEffectSnow::mySnowEffectTextureId
protected
GLuint64 makVrv::DtShaderEffectSnow::mySnowEffectImageHandle
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtShaderEffectSnow::mySnowEffectTexture
protected
const DtIndirectTexturePrototype* makVrv::DtShaderEffectSnow::mySnowEffectVrvTexture = nullptr
protected
DtIndirectGlTextureObject* makVrv::DtShaderEffectSnow::mySnowEffectTextureBindless = nullptr
protected
bool makVrv::DtShaderEffectSnow::mySnowEnabled
protected
bool makVrv::DtShaderEffectSnow::myImGuiSnowEnabled
protected
float makVrv::DtShaderEffectSnow::mySnowUpThresholdRange
protected
float makVrv::DtShaderEffectSnow::mySnowUpThresholdMin
protected
float makVrv::DtShaderEffectSnow::mySnowElevationMin
protected
float makVrv::DtShaderEffectSnow::mySnowElevationRange
protected
float makVrv::DtShaderEffectSnow::mySnowMaskedRoadMax
protected
float makVrv::DtShaderEffectSnow::mySnowMaskedRoadRange
protected
bool makVrv::DtShaderEffectSnow::myEnableBlowingSnow
protected
osg::Vec4 makVrv::DtShaderEffectSnow::mySnowColor
protected
float makVrv::DtShaderEffectSnow::myWindSpeedMps
protected
float makVrv::DtShaderEffectSnow::myWindDirectionRad
protected
float makVrv::DtShaderEffectSnow::myWindOffset
protected
double makVrv::DtShaderEffectSnow::myLastSimulationTime
protected
DtVector makVrv::DtShaderEffectSnow::myCameraLocation
protected
double makVrv::DtShaderEffectSnow::myCameraAltitude
protected
DtOsgWeatherEffectsObject* makVrv::DtShaderEffectSnow::myWeatherEffectsObject
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)