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

The DtOsgWaterRipples class provides water ripple effects for water bodies.

These ripple effects are based on a 2D generated image that contains tilable water ripple patterns. The image is converted to a normal map texture which is used in a shader. The image creation is based on a set of parameters that are contained in a DtWaterRipplesManager::PresetInfo structure.

The DtWaterRipplesManager::PresetInfo also contains other parameters that can be adjusted on the fly and are sent to the shader such as base water color and animation speed.

The DtOsgWaterRipples objects are meant to be managed by a DtOsgWaterRipplesManager object.

The class makes use of bindless textures. The DtOsgWaterRipplesManager class is responsible for calling updateTextureUniforms and updateParameterUniforms at approriate times to keep data current for rendering.

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

Classes

struct  TextureInfo
 

Public Member Functions

virtual ~DtOsgWaterRipples ()
 
 DtOsgWaterRipples (const DtOsgWaterRipples &other)=delete
 
 DtOsgWaterRipples (const DtOsgWaterRipples &&other)=delete
 
DtOsgWaterRipples & operator= (const DtOsgWaterRipples &other)=delete
 
DtOsgWaterRipples & operator= (const DtOsgWaterRipples &&other)=delete
 
virtual void releaseGLObjects (osg::State *state)
 
virtual void releaseBindlessTextureObjects ()
 
void releaseTextures ()
 
virtual void updatePreset (DtWaterRipplesManager::PresetInfo &preset)
 
virtual void setNeedInitialize (bool value)
 
virtual bool needInitialize () const
 
virtual void initialize (const std::vector< osg::StateSet * > &stateSets, const std::vector< DtWaterRipplesManager::PresetInfo > &presets)
 
virtual float computeWindStrength () const
 
virtual void updateTextureUniforms ()
 
virtual void updateParameterUniforms (double time, bool enableInShader)
 
virtual void removeUniformFromStateSets (const std::string &name, const std::vector< osg::StateSet * > &stateSets)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static const std::string & theClassName ()
 

Public Attributes

friend DtOsgWaterRipplesCreator
 

Protected Member Functions

 DtOsgWaterRipples (DtDe &de)
 
virtual int addTexture (osg::Texture *osgTexture, DtIndirectTexturePrototype *vrvTexture)
 
virtual osg::ref_ptr
< osg::Texture2D > 
createWaterRipplesTexture (const DtWaterRipplesManager::PresetInfo &preset, int nameIndex)
 

Protected Attributes

DtDe & myDe
 
bool myNeedInitialize
 
std::vector
< DtWaterRipplesManager::PresetInfo > 
myPresetInfo
 
std::vector
< DtOsgWaterRipples::TextureInfo > 
myTextures
 
osg::ref_ptr< osg::Uniform > myTextureHandlesUniform
 
osg::ref_ptr< osg::Uniform > myParametersUniform
 

Constructor & Destructor Documentation

virtual makVrv::DtOsgWaterRipples::~DtOsgWaterRipples ( )
virtual
makVrv::DtOsgWaterRipples::DtOsgWaterRipples ( const DtOsgWaterRipples &  other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtOsgWaterRipples::DtOsgWaterRipples ( const DtOsgWaterRipples &&  other)
delete

Move Constructor not implemented - Move not allowed.

makVrv::DtOsgWaterRipples::DtOsgWaterRipples ( DtDe &  de)
protected

CTOR. only creator can create.

Member Function Documentation

static const std::string& makVrv::DtOsgWaterRipples::theClassName ( )
static

Get the name used to register this class.

DtOsgWaterRipples& makVrv::DtOsgWaterRipples::operator= ( const DtOsgWaterRipples &  other)
delete

Assignment Operator not implemented - Assignment not allowed.

DtOsgWaterRipples& makVrv::DtOsgWaterRipples::operator= ( const DtOsgWaterRipples &&  other)
delete

Move Assignment Operator not implemented - Move Assignment not allowed.

virtual void makVrv::DtOsgWaterRipples::releaseGLObjects ( osg::State *  state)
virtual

release the gl objects for this class.

virtual void makVrv::DtOsgWaterRipples::releaseBindlessTextureObjects ( )
virtual

Release all bindless texture objects. Does not release the osg textures, only the bindless texture objects.

void makVrv::DtOsgWaterRipples::releaseTextures ( )

Release all textures. Non-virtual because called by destructor.

virtual void makVrv::DtOsgWaterRipples::updatePreset ( DtWaterRipplesManager::PresetInfo &  preset)
virtual

Update the preset information for the water ripples.

virtual void makVrv::DtOsgWaterRipples::setNeedInitialize ( bool  value)
virtual

Set whether the water ripples need initialized.

virtual bool makVrv::DtOsgWaterRipples::needInitialize ( ) const
virtual

Check if the water ripples need initialized.

virtual void makVrv::DtOsgWaterRipples::initialize ( const std::vector< osg::StateSet * > &  stateSets,
const std::vector< DtWaterRipplesManager::PresetInfo > &  presets 
)
virtual
virtual float makVrv::DtOsgWaterRipples::computeWindStrength ( ) const
virtual

Computes a 0.0 to 1.0 value representing the wind strength. This value is passed to the shader.

virtual void makVrv::DtOsgWaterRipples::updateTextureUniforms ( )
virtual

called by the GPU arena per frame, per context to check if the texture has been assigned an address.

virtual void makVrv::DtOsgWaterRipples::updateParameterUniforms ( double  time,
bool  enableInShader 
)
virtual

called during manager update to update any parameter uniforms.

virtual void makVrv::DtOsgWaterRipples::removeUniformFromStateSets ( const std::string &  name,
const std::vector< osg::StateSet * > &  stateSets 
)
virtual

Helper to remove the named uniform from the provided state sets.

virtual int makVrv::DtOsgWaterRipples::addTexture ( osg::Texture *  osgTexture,
DtIndirectTexturePrototype *  vrvTexture 
)
protectedvirtual

Add a water ripple texture to the manager.

virtual osg::ref_ptr<osg::Texture2D> makVrv::DtOsgWaterRipples::createWaterRipplesTexture ( const DtWaterRipplesManager::PresetInfo &  preset,
int  nameIndex 
)
protectedvirtual

Create the water ripples texture. nameIndex - an index to append to the texture name for uniqueness.

Member Data Documentation

friend makVrv::DtOsgWaterRipples::DtOsgWaterRipplesCreator

only creator can create

DtDe& makVrv::DtOsgWaterRipples::myDe
protected
bool makVrv::DtOsgWaterRipples::myNeedInitialize
protected
std::vector<DtWaterRipplesManager::PresetInfo> makVrv::DtOsgWaterRipples::myPresetInfo
protected
std::vector<DtOsgWaterRipples::TextureInfo> makVrv::DtOsgWaterRipples::myTextures
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgWaterRipples::myTextureHandlesUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgWaterRipples::myParametersUniform
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)