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) 2023 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 
84  virtual void updateUniforms();
85 
87  virtual void setCameraLocation(const DtVector& location);
88 
89  // \brief gets the location for localized effects.
90  virtual const DtVector& cameraLocation() const;
91 
93  virtual int rainEffectTextureSize(void) const;
94 
95  protected:
96 
98  virtual void installShader(const std::vector<osg::StateSet*>& stateSets);
99 
101  virtual void uninstallShader(const std::vector<osg::StateSet*>& stateSets);
102 
104  virtual DtRainEffectGeneration* createRainEffectOp();
105 
107  virtual void removeRainEffectGenerationOp(void);
108 
110  virtual void slot_rainAccumulationChanged(double depth);
111 
113  virtual void updateEnabledState(const float depth);
114 
115  public:
116 
118  static const std::string& theClassName();
119 
120  protected:
121 
123 
128 
129  const DtIndirectTexturePrototype* myRainEffectVrvTexture = nullptr;
130  DtIndirectGlTextureObject* myRainEffectTextureBindless = nullptr;
131 
135 
139 
141 
142  osg::Vec4 myRainColor;
143 
145 
147 
148  DtRainEffectGeneration* myRainEffectGenerationOp = nullptr;
149 
152 
154 
155  const int myRainEffectTextureSize = 512;
156 
157  };
158 }
float myRainMaskedRoadRange
Definition: DtShaderEffectRain.h:137
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:126
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:134
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:124
osg::Vec4 myRainColor
Definition: DtShaderEffectRain.h:142
DtVirtualBaseClassCreator< DtShaderEffectRain > DtShaderEffectRainCreator
creator
Definition: DtShaderEffectRain.h:40
Contains makVrv::DtShaderEffect class.
bool myEnablePuddleEffects
Definition: DtShaderEffectRain.h:140
osg::ref_ptr< osg::Uniform > myRainUpThresholdUniform
Definition: DtShaderEffectRain.h:125
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:151
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
float myRainMaskedRoadMax
Definition: DtShaderEffectRain.h:136
float myRainUpThresholdRange
Definition: DtShaderEffectRain.h:133
DtSignalConnectionManager myConnections
Definition: DtShaderEffectRain.h:122
Definition: DtRainEffectGeneration.h:27
DtVector myCameraLocation
Definition: DtShaderEffectRain.h:150
Base class to provide boost signal/slot management.
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectRain.h:144
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:153
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
float myRainAccumulationDepth
Definition: DtShaderEffectRain.h:138
bool myRainEnabled
Definition: DtShaderEffectRain.h:132
osg::ref_ptr< osg::Uniform > myRainMaskedRoadUniform
Definition: DtShaderEffectRain.h:127

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)