VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgWaterRipples.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <vrvOsg/DtGpuOperation.h>
15 
17 
18 #include <osg/observer_ptr>
19 #include <osg/ref_ptr>
20 
21 #include <map>
22 #include <vector>
23 
24 namespace osg
25 {
26  class State;
27  class StateSet;
28  class Texture;
29  class Texture2D;
30  class Uniform;
31 }
32 
33 namespace makVrv
34 {
35  // Forward declarations.
36  class DtIndirectGlTextureObject;
37  class DtIndirectTexturePrototype;
39 
42 
44  template <>
45  inline const char* creatorTypeName<DtOsgWaterRipples>() { return "DtOsgWaterRipplesCreator"; }
46 
47 
66  {
67  public:
68 
71 
73  struct TextureInfo
74  {
75  public:
77  DtIndirectTexturePrototype* myVrvTexture = nullptr;
78  GLuint64 myTextureAddress = 0;
79  DtIndirectGlTextureObject* myTextureBindless = nullptr;
80  };
81 
82 
84  static const std::string& theClassName();
85 
86  public:
87 
88  virtual ~DtOsgWaterRipples();
89 
92  const DtOsgWaterRipples& other) = delete;
93 
96  const DtOsgWaterRipples&& other) = delete;
97 
99  DtOsgWaterRipples& operator=(
100  const DtOsgWaterRipples& other) = delete;
101 
103  DtOsgWaterRipples& operator=(
104  const DtOsgWaterRipples&& other) = delete;
105 
106  protected:
107 
109  DtOsgWaterRipples(DtDe& de);
110 
111  public:
112 
114  virtual void releaseGLObjects(osg::State* state);
115 
118  virtual void releaseBindlessTextureObjects();
119 
122  void releaseTextures();
123 
125  virtual void updatePreset(DtWaterRipplesManager::PresetInfo& preset);
126 
128  virtual void setNeedInitialize(bool value);
129 
131  virtual bool needInitialize() const;
132 
133  virtual void initialize(const std::vector<osg::StateSet*>& stateSets,
134  const std::vector<DtWaterRipplesManager::PresetInfo>& presets);
135 
138  virtual float computeWindStrength() const;
139 
141  virtual void updateTextureUniforms();
142 
144  virtual void updateParameterUniforms(double time, bool enableInShader);
145 
147  virtual void removeUniformFromStateSets(const std::string& name, const std::vector<osg::StateSet*>& stateSets);
148 
149  protected:
150 
152  virtual int addTexture(osg::Texture* osgTexture, DtIndirectTexturePrototype* vrvTexture);
153 
156  virtual osg::ref_ptr<osg::Texture2D> createWaterRipplesTexture(
157  const DtWaterRipplesManager::PresetInfo& preset, int nameIndex);
158 
159  protected:
160 
162 
164 
165  std::vector<DtWaterRipplesManager::PresetInfo> myPresetInfo;
166  std::vector<DtOsgWaterRipples::TextureInfo> myTextures;
169  };
170 
171 }
172 
173 
std::vector< DtWaterRipplesManager::PresetInfo > myPresetInfo
Definition: DtOsgWaterRipples.h:165
The DtOsgWaterRipples class provides water ripple effects for water bodies.
Definition: DtOsgWaterRipples.h:65
osg::ref_ptr< osg::Uniform > myParametersUniform
Definition: DtOsgWaterRipples.h:168
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Encapsulate an OpenGL texture object that is created/used in indirect rendering.
Definition: DtIndirectGlTextureObject.h:36
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
std::vector< DtOsgWaterRipples::TextureInfo > myTextures
Definition: DtOsgWaterRipples.h:166
DtDe & myDe
Definition: DtOsgWaterRipples.h:161
DtVirtualBaseClassCreator< DtOsgWaterRipples > DtOsgWaterRipplesCreator
creator
Definition: DtOsgWaterRipples.h:38
bool myNeedInitialize
Definition: DtOsgWaterRipples.h:163
Contains the DtGpuOperation class declaration.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
Contains makVrv::DtOsgWaterRipplesManager class.
Information about a water ripple preset.
Definition: DtWaterRipplesManager.h:34
osg::ref_ptr< osg::Uniform > myTextureHandlesUniform
Definition: DtOsgWaterRipples.h:167
const char * creatorTypeName< DtOsgWaterRipples >()
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtOsgWaterRipples.h:45
Contains DLL export macros.
friend DtOsgWaterRipplesCreator
only creator can create
Definition: DtOsgWaterRipples.h:70
Information about a water ripple texture.
Definition: DtOsgWaterRipples.h:73
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
VRV/Indirect uses its own texture paradigm: DtIndirectTexturePrototype, which is a &#39;template&#39; for mak...
Definition: DtIndirectTexturePrototype.h:53
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOsgWaterRipples.h:76

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)