![]() |
VR-Forces Developer's Guide
|
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.

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 |
|
virtual |
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
delete |
Move Constructor not implemented - Move not allowed.
|
protected |
CTOR. only creator can create.
|
static |
Get the name used to register this class.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
delete |
Move Assignment Operator not implemented - Move Assignment not allowed.
|
virtual |
release the gl objects for this class.
|
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 |
Update the preset information for the water ripples.
|
virtual |
Set whether the water ripples need initialized.
|
virtual |
Check if the water ripples need initialized.
|
virtual |
|
virtual |
Computes a 0.0 to 1.0 value representing the wind strength. This value is passed to the shader.
|
virtual |
called by the GPU arena per frame, per context to check if the texture has been assigned an address.
|
virtual |
called during manager update to update any parameter uniforms.
|
virtual |
Helper to remove the named uniform from the provided state sets.
|
protectedvirtual |
Add a water ripple texture to the manager.
|
protectedvirtual |
Create the water ripples texture. nameIndex - an index to append to the texture name for uniqueness.
| friend makVrv::DtOsgWaterRipples::DtOsgWaterRipplesCreator |
only creator can create
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |