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) 2022 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);
72 
74  virtual void releaseGLObjects(osg::State* state) override;
75 
77  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
78 
80  virtual void reloadShader();
81 
83  virtual void updateImGui();
84 
86  virtual void updateUniforms();
87 
89  virtual void setCameraLocation(const DtVector& location);
90 
91  // \brief gets the location for localized effects.
92  virtual const DtVector& cameraLocation() const;
93 
96  virtual void setWindSpeed(float speed);
97 
100  virtual void setWindDirection(float direction);
101 
102  public:
103 
105  static const std::string& theClassName();
106 
107  protected:
108 
110  virtual void installShader(const std::vector<osg::StateSet*>& stateSets);
111 
113  virtual void uninstallShader(const std::vector<osg::StateSet*>& stateSets);
114 
116  virtual void updateEnabledState();
117 
119  virtual void slot_snowAccumulationChanged(double depth);
120 
122  virtual void slot_snowRoadAccumulationChanged(double depth);
123 
125  virtual void slot_snowMinimumElevationChanged(double elevation);
126 
128  virtual void slot_snowElevationTransitionChanged(double elevation);
129 
131  virtual void slot_PreObserverUpdate(double simTime);
132  protected:
133 
135 
142 
146  const DtIndirectTexturePrototype* mySnowEffectVrvTexture = nullptr;
147  DtIndirectGlTextureObject* mySnowEffectTextureBindless = nullptr;
148 
155 
158 
160 
161  osg::Vec4 mySnowColor;
162 
163  //x,y wind direction, z wind speed, w wind angle radians.
164  osg::Vec4 myWindUniform;
165 
168 
171 
173 
174  friend class DtSnowEffectGeneration;
175  };
176 }
osg::ref_ptr< osg::Uniform > mySnowMaskedRoadUniform
Definition: DtShaderEffectSnow.h:139
osg::ref_ptr< osg::Uniform > myEnableSnowUniform
Definition: DtShaderEffectSnow.h:136
float mySnowUpThresholdMin
Definition: DtShaderEffectSnow.h:152
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:141
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:151
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:134
GLuint mySnowEffectTextureId
Definition: DtShaderEffectSnow.h:143
Contains makVrv::DtShaderEffect class.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
float mySnowMaskedRoadMax
Definition: DtShaderEffectSnow.h:156
osg::ref_ptr< osg::Uniform > mySnowWindUniform
Definition: DtShaderEffectSnow.h:140
float myWindOffset
Definition: DtShaderEffectSnow.h:166
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< osg::Uniform > mySnowUpThresholdUniform
Definition: DtShaderEffectSnow.h:137
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectSnow.h:172
Base class to provide boost signal/slot management.
osg::Vec4 myWindUniform
Definition: DtShaderEffectSnow.h:164
bool mySnowEnabled
Definition: DtShaderEffectSnow.h:149
osg::ref_ptr< osg::Texture2D > mySnowEffectTexture
Definition: DtShaderEffectSnow.h:145
float mySnowElevationRange
Definition: DtShaderEffectSnow.h:154
GLuint64 mySnowEffectImageHandle
Definition: DtShaderEffectSnow.h:144
Contains DLL export macros.
osg::ref_ptr< osg::Uniform > mySnowColorUniform
Definition: DtShaderEffectSnow.h:138
float mySnowElevationMin
Definition: DtShaderEffectSnow.h:153
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:72
DtVector myCameraLocation
Definition: DtShaderEffectSnow.h:169
bool myImGuiSnowEnabled
Definition: DtShaderEffectSnow.h:150
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:167
bool myEnableBlowingSnow
Definition: DtShaderEffectSnow.h:159
double myCameraAltitude
Definition: DtShaderEffectSnow.h:170
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
osg::Vec4 mySnowColor
Definition: DtShaderEffectSnow.h:161
DtShaderEffectSnow injects custom shaders into the scene, Handles snow on the ground causing the grou...
Definition: DtShaderEffectSnow.h:52
float mySnowMaskedRoadRange
Definition: DtShaderEffectSnow.h:157

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)