VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShaderEffectManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
17 
20 
21 #include <string>
22 
23 #include <osg/ref_ptr>
24 #include <osg/Vec3d>
25 #include <osg/Matrixd>
26 #include <osg/OperationThread>
27 #include <osg/Object>
28 #include <osg/State>
29 #include <osg/RenderInfo>
30 
31 namespace makVrv
32 {
33  class DtOsgWeatherEffectsObject;
34  class DtShaderEffect;
35  class DtOsgChannel;
36 
42  {
43  protected:
44 
45  typedef std::set<DtShaderEffect*> ShaderEffectSet;
46 
47  public:
48 
51  {
52  public:
53  osg::Vec3d myLocalPostion;
56  };
57 
58  // Inner class for passing the current render info from the main thread.
59  // Calls findTextureAddresses in order to setup the texture addresses as they are
60  // made resident
61  class TextureAddressJob : public osg::Operation
62  {
63  public:
66  virtual ~TextureAddressJob();
67 
69  virtual void operator () (osg::Object* sv);
70 
72  virtual void release();
73 
74  protected:
76 
77  };
78 
79  public:
81  virtual ~DtShaderEffectManager();
82 
84  DtShaderEffectManager() = delete;
88  DtShaderEffectManager &operator=(const DtShaderEffectManager&) = delete;
89 
90  protected:
93 
94  public:
97  virtual void initializeEffects();
98 
100  virtual void findTextureAddresses(osg::RenderInfo& renderInfo);
101 
103  virtual TextureAddressJob* createTextureAddressJob();
104 
106  virtual void update();
107 
109  virtual void updateChannel(DtOsgChannel* channel, osg::Vec3d pos);
110 
112  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
113 
115  virtual void slot_reloadShader();
116 
118  virtual void slot_elevationalConfigurationUpdated(DtEnvironmentInterface::DtElevationalConfigurationRecord rec);
119 
121  virtual DtOsgWeatherEffectsObject* findWeatherEffectsObject();
122 
124  virtual const DtOsgWeatherEffectsObject* findWeatherEffectsObject() const;
125 
127  virtual void releaseGLObjects(osg::State* state);
128 
129  public:
131  static DtShaderEffectManager& instance(DtDe& de);
132 
134  static const std::string& theClassName();
135 
136  protected:
137 
139  virtual void updateImGui();
140 
142  virtual void updateUniforms();
143 
145  virtual DtShaderEffectPerChannelData& getOrCreatePerChannelData(osg::Camera* camera);
146 
148  virtual void flushInvalidChannels();
149 
150  protected:
151 
153 
155 
157 
159 
160  typedef std::map< osg::observer_ptr<osg::Camera>, DtShaderEffectPerChannelData*> PerChannelDataMap;
162 
165 
167 
169 
171  float myWindSpeed;
175  };
176 }
float myVisibilityDistance
Definition: DtShaderEffectManager.h:173
osg::ref_ptr< osg::CoordinateSystemNode > CoordinateSystemNodeRef
Definition: DtShaderEffectManager.h:163
float myWindDirection
Definition: DtShaderEffectManager.h:172
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectManager.h:166
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:90
Virtual base class.
Definition: DtVirtualBaseClass.h:19
The declaration of the makVrv::DtEnvironmentInterface class.
ShaderEffectSet myShaderEffectSet
Definition: DtShaderEffectManager.h:55
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
Contains the DtIndirectTextureProcessor class declaration.
DtShaderEffectManager injects custom shaders into the scenes, uses DtShaderEffect objects to add rend...
Definition: DtShaderEffectManager.h:41
float myWindBaseMSAltitude
Definition: DtShaderEffectManager.h:170
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:77
VisibilityObscurant
Definition: DtEnvironmentRecord.h:21
osg::Vec3d myLocalPostion
Definition: DtShaderEffectManager.h:53
Record for an elevational configuration A record of this type consists of 1) a base MSL altitude...
Definition: DtEnvironmentRecord.h:236
float myWindSpeed
Definition: DtShaderEffectManager.h:171
osg::ref_ptr< DtIndirectTextureProcessor > myTextureProcessor
Definition: DtShaderEffectManager.h:156
Contains makVrv::DtVirtualBaseClass class.
DtDe & myDe
Definition: DtShaderEffectManager.h:152
std::set< DtShaderEffect * > ShaderEffectSet
Definition: DtShaderEffectManager.h:45
CoordinateSystemNodeRef myCoordSystemNode
Definition: DtShaderEffectManager.h:164
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< TextureAddressJob > myTextureAddressJob
Definition: DtShaderEffectManager.h:168
Structure for holding per channel data for the effects.
Definition: DtShaderEffectManager.h:50
DtShaderEffectManager & myShaderEffectManager
Definition: DtShaderEffectManager.h:75
osg::Matrixd myLocalMatrixTranformInverse
Definition: DtShaderEffectManager.h:54
Base class to provide boost signal/slot management.
DtEnvironmentInterface::VisibilityObscurant myVisibilityObscurant
Definition: DtShaderEffectManager.h:174
std::map< osg::observer_ptr< osg::Camera >, DtShaderEffectPerChannelData * > PerChannelDataMap
Definition: DtShaderEffectManager.h:160
DtSignalConnectionManager myConnections
Definition: DtShaderEffectManager.h:154
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtOsgRenderer & myOsgRenderer
Definition: DtShaderEffectManager.h:158
PerChannelDataMap myPerChannelDataMap
Definition: DtShaderEffectManager.h:161
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
Definition: DtShaderEffectManager.h:61

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)