VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShaderEffectSnow.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 
19 
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 DtShaderEffectSnow;
38  class DtIndirectTexturePrototype;
40 
43 
45  template <>
46  inline const char* creatorTypeName<DtShaderEffectSnow>(void) { return "DtShaderEffectSnowCreator"; }
47 
53  {
54  public:
56  virtual ~DtShaderEffectSnow();
57 
60 
62  DtShaderEffectSnow() = delete;
64  DtShaderEffectSnow(const DtShaderEffectSnow&) = delete;
66  DtShaderEffectSnow &operator=(const DtShaderEffectSnow&) = delete;
67 
68  public:
71  virtual void initializeEffect(const std::vector<osg::StateSet*>& statesets) override;
72 
74  virtual void releaseGLObjects(osg::State* state) override;
75 
77  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject) override;
78 
80  virtual void updateImGui() override;
81 
85  virtual void updateStateAndUniforms() override;
86 
88  virtual bool isEnabled() const override;
89 
91  virtual void setCameraLocation(const DtVector& location) override;
92 
93  // \brief gets the location for localized effects.
94  virtual const DtVector& cameraLocation() const;
95 
96  public:
97 
99  static const std::string& theClassName();
100 
101  protected:
102 
104  virtual void installShader(const std::vector<osg::StateSet*>& stateSets);
105 
107  virtual void uninstallShader(const std::vector<osg::StateSet*>& stateSets);
108 
110  virtual void updateEnabledState();
111 
114  virtual void updateWindUniform();
115 
117  virtual void updateLocalizedWind(const DtVector& location);
118 
120  virtual void slot_snowAccumulationChanged(double depth);
121 
123  virtual void slot_snowRoadAccumulationChanged(double depth);
124 
126  virtual void slot_snowMinimumElevationChanged(double elevation);
127 
129  virtual void slot_snowElevationTransitionChanged(double elevation);
130 
132  virtual void slot_PreObserverUpdate(double simTime);
133  protected:
134 
136 
143 
147  const DtIndirectTexturePrototype* mySnowEffectVrvTexture = nullptr;
148  DtIndirectGlTextureObject* mySnowEffectTextureBindless = nullptr;
149 
156 
159 
161 
162  osg::Vec4 mySnowColor;
163 
166 
169 
172 
174 
175  friend class DtSnowEffectGeneration;
176  };
177 }
osg::ref_ptr< osg::Uniform > mySnowMaskedRoadUniform
Definition: DtShaderEffectSnow.h:140
osg::ref_ptr< osg::Uniform > myEnableSnowUniform
Definition: DtShaderEffectSnow.h:137
float mySnowUpThresholdMin
Definition: DtShaderEffectSnow.h:153
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 > mySnowPolyMaskUniform
Definition: DtShaderEffectSnow.h:142
Encapsulate an OpenGL texture object that is created/used in indirect rendering.
Definition: DtIndirectGlTextureObject.h:36
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtVirtualBaseClassCreator< DtShaderEffectSnow > DtShaderEffectSnowCreator
creator
Definition: DtShaderEffectSnow.h:39
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:18
float mySnowUpThresholdRange
Definition: DtShaderEffectSnow.h:152
const char * creatorTypeName< DtShaderEffectSnow >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtShaderEffectSnow.h:46
DtSignalConnectionManager myConnections
Definition: DtShaderEffectSnow.h:135
GLuint mySnowEffectTextureId
Definition: DtShaderEffectSnow.h:144
Contains makVrv::DtShaderEffect class.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
float myWindSpeedMps
Definition: DtShaderEffectSnow.h:164
float mySnowMaskedRoadMax
Definition: DtShaderEffectSnow.h:157
osg::ref_ptr< osg::Uniform > mySnowWindUniform
Definition: DtShaderEffectSnow.h:141
float myWindOffset
Definition: DtShaderEffectSnow.h:167
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
float myWindDirectionRad
Definition: DtShaderEffectSnow.h:165
osg::ref_ptr< osg::Uniform > mySnowUpThresholdUniform
Definition: DtShaderEffectSnow.h:138
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectSnow.h:173
Base class to provide boost signal/slot management.
bool mySnowEnabled
Definition: DtShaderEffectSnow.h:150
osg::ref_ptr< osg::Texture2D > mySnowEffectTexture
Definition: DtShaderEffectSnow.h:146
float mySnowElevationRange
Definition: DtShaderEffectSnow.h:155
GLuint64 mySnowEffectImageHandle
Definition: DtShaderEffectSnow.h:145
Contains DLL export macros.
osg::ref_ptr< osg::Uniform > mySnowColorUniform
Definition: DtShaderEffectSnow.h:139
float mySnowElevationMin
Definition: DtShaderEffectSnow.h:154
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
DtVector myCameraLocation
Definition: DtShaderEffectSnow.h:170
bool myImGuiSnowEnabled
Definition: DtShaderEffectSnow.h:151
VRV/Indirect uses its own texture paradigm: DtIndirectTexturePrototype, which is a &#39;template&#39; for mak...
Definition: DtIndirectTexturePrototype.h:53
double myLastSimulationTime
Definition: DtShaderEffectSnow.h:168
bool myEnableBlowingSnow
Definition: DtShaderEffectSnow.h:160
double myCameraAltitude
Definition: DtShaderEffectSnow.h:171
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
osg::Vec4 mySnowColor
Definition: DtShaderEffectSnow.h:162
DtShaderEffectSnow injects custom shaders into the scene, Handles snow on the ground causing the grou...
Definition: DtShaderEffectSnow.h:52
float mySnowMaskedRoadRange
Definition: DtShaderEffectSnow.h:158

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)