VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShaderEffectRain.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 
14 #include <vrvOsg/DtShaderEffect.h>
15 
17 
20 
21 #include <osg/ref_ptr>
22 #include <osg/Texture2D>
23 #include <osg/Uniform>
24 #include <osg/Object>
25 #include <osg/StateSet>
26 #include <osg/OperationThread>
27 #include <osg/Vec4>
28 #include <osg/State>
29 
30 #include <string>
31 #include <vector>
32 
33 namespace makVrv
34 {
35  class DtOsgWeatherEffectsObject;
36  class DtGlProgram;
37  class DtShaderEffectRain;
38  class DtIndirectTexturePrototype;
39  class DtIndirectGlTextureObject;
41 
44 
46  template <>
47  inline const char* creatorTypeName<DtShaderEffectRain>(void) { return "DtShaderEffectRainCreator"; }
48 
54  {
55  public:
58 
60  virtual ~DtShaderEffectRain();
61 
63  DtShaderEffectRain() = delete;
65  DtShaderEffectRain(const DtShaderEffectRain&) = delete;
67  DtShaderEffectRain &operator=(const DtShaderEffectRain&) = delete;
68 
69  public:
72  virtual void initializeEffect(const std::vector<osg::StateSet*>& stateSets);
73 
75  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
76 
78  virtual void releaseGLObjects(osg::State* state) override;
79 
81  virtual void updateImGui();
82 
86  virtual void updateStateAndUniforms() override;
87 
89  virtual bool isEnabled() const override;
90 
92  virtual void setCameraLocation(const DtVector& location) override;
93 
94  // \brief gets the location for localized effects.
95  virtual const DtVector& cameraLocation() const;
96 
98  virtual int rainEffectTextureSize(void) const;
99 
100  protected:
101 
103  virtual void installShader(const std::vector<osg::StateSet*>& stateSets);
104 
106  virtual void uninstallShader(const std::vector<osg::StateSet*>& stateSets);
107 
109  virtual DtRainEffectGeneration* createRainEffectOp();
110 
112  virtual void removeRainEffectGenerationOp(void);
113 
115  virtual void slot_rainAccumulationChanged(double depth);
116 
118  virtual void updateEnabledState(const float depth);
119 
120  public:
121 
123  static const std::string& theClassName();
124 
125  protected:
126 
128 
133 
134  const DtIndirectTexturePrototype* myRainEffectVrvTexture = nullptr;
135  DtIndirectGlTextureObject* myRainEffectTextureBindless = nullptr;
136 
140 
144 
146 
147  osg::Vec4 myRainColor;
148 
150 
152 
153  DtRainEffectGeneration* myRainEffectGenerationOp = nullptr;
154 
157 
159 
160  const int myRainEffectTextureSize = 512;
161 
162  };
163 }
float myRainMaskedRoadRange
Definition: DtShaderEffectRain.h:142
DtShaderEffect injects custom shaders into the scenes, There are derrived classes of this for snow an...
Definition: DtShaderEffect.h:42
osg::ref_ptr< osg::Uniform > myRainColorUniform
Definition: DtShaderEffectRain.h:131
Encapsulate an OpenGL texture object that is created/used in indirect rendering.
Definition: DtIndirectGlTextureObject.h:36
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
float myRainUpThresholdMin
Definition: DtShaderEffectRain.h:139
DtShaderEffectRain injects custom shaders into the scene, Handles rain on the ground causing the grou...
Definition: DtShaderEffectRain.h:53
osg::ref_ptr< osg::Uniform > myEnableRainUniform
Definition: DtShaderEffectRain.h:129
osg::Vec4 myRainColor
Definition: DtShaderEffectRain.h:147
DtVirtualBaseClassCreator< DtShaderEffectRain > DtShaderEffectRainCreator
creator
Definition: DtShaderEffectRain.h:40
Contains makVrv::DtShaderEffect class.
bool myEnablePuddleEffects
Definition: DtShaderEffectRain.h:145
osg::ref_ptr< osg::Uniform > myRainUpThresholdUniform
Definition: DtShaderEffectRain.h:130
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
Contains makVrv::DtRandomNumberGenerator class.
const char * creatorTypeName< DtShaderEffectRain >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtShaderEffectRain.h:47
double myCameraAltitude
Definition: DtShaderEffectRain.h:156
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
float myRainMaskedRoadMax
Definition: DtShaderEffectRain.h:141
float myRainUpThresholdRange
Definition: DtShaderEffectRain.h:138
DtSignalConnectionManager myConnections
Definition: DtShaderEffectRain.h:127
Definition: DtRainEffectGeneration.h:27
DtVector myCameraLocation
Definition: DtShaderEffectRain.h:155
Base class to provide boost signal/slot management.
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectRain.h:149
Contains DLL export macros.
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
float myPrecipitationIntensity
Definition: DtShaderEffectRain.h:158
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
float myRainAccumulationDepth
Definition: DtShaderEffectRain.h:143
bool myRainEnabled
Definition: DtShaderEffectRain.h:137
osg::ref_ptr< osg::Uniform > myRainMaskedRoadUniform
Definition: DtShaderEffectRain.h:132

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)