VR-Forces 5.0.1 Developer's Guide
 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) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
18 
19 #include <string>
20 
21 #include <osg/ref_ptr>
22 #include <osg/Vec3d>
23 #include <osg/Matrixd>
24 #include <osg/OperationThread>
25 #include <osg/Object>
26 #include <osg/State>
27 #include <osg/RenderInfo>
28 
29 namespace makVrv
30 {
31  class DtOsgWeatherEffectsObject;
32  class DtShaderEffect;
33  class DtOsgChannel;
34 
40  {
41  protected:
42 
43  typedef std::set<DtShaderEffect*> ShaderEffectSet;
44 
45  public:
46 
49  {
50  public:
51  osg::Vec3d myLocalPostion;
54  };
55 
56  // Inner class for passing the current render info from the main thread.
57  // Calls findTextureAddresses in order to setup the texture addresses as they are
58  // made resident
59  class TextureAddressJob : public osg::Operation
60  {
61  public:
64  virtual ~TextureAddressJob();
65 
67  virtual void operator () (osg::Object* sv);
68 
70  virtual void release();
71 
72  protected:
74  };
75 
76  public:
78  virtual ~DtShaderEffectManager();
79 
81  DtShaderEffectManager() = delete;
85  DtShaderEffectManager &operator=(const DtShaderEffectManager&) = delete;
86 
87  protected:
90 
91  public:
94  virtual void initializeEffects();
95 
97  virtual void findTextureAddresses(const osg::GraphicsContext* gc);
98 
100  virtual TextureAddressJob* createTextureAddressJob();
101 
103  virtual void update();
104 
106  virtual void updateChannel(DtOsgChannel* channel, osg::Vec3d pos);
107 
109  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
110 
112  virtual void slot_reloadShader();
113 
115  virtual void slot_windSpeedChanged(float metersPerSecond);
116 
118  virtual void slot_windDirectionChanged(float radians);
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 
161 
162  typedef std::map< osg::observer_ptr<osg::Camera>, DtShaderEffectPerChannelData*> PerChannelDataMap;
164 
167 
169 
171 
172  float myWindSpeed;
174  };
175 }
osg::ref_ptr< osg::CoordinateSystemNode > CoordinateSystemNodeRef
Definition: DtShaderEffectManager.h:165
float myWindDirection
Definition: DtShaderEffectManager.h:173
DtOsgWeatherEffectsObject * myWeatherEffectsObject
Definition: DtShaderEffectManager.h:168
DtIndirectLimitTextureStrategy * myNoTextureLimitStrategy
Definition: DtShaderEffectManager.h:158
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:87
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
ShaderEffectSet myShaderEffectSet
Definition: DtShaderEffectManager.h:53
#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:39
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:52
osg::Vec3d myLocalPostion
Definition: DtShaderEffectManager.h:51
float myWindSpeed
Definition: DtShaderEffectManager.h:172
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:43
CoordinateSystemNodeRef myCoordSystemNode
Definition: DtShaderEffectManager.h:166
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< TextureAddressJob > myTextureAddressJob
Definition: DtShaderEffectManager.h:170
Structure for holding per channel data for the effects.
Definition: DtShaderEffectManager.h:48
DtShaderEffectManager & myShaderEffectManager
Definition: DtShaderEffectManager.h:73
This class is passed as a pointer to DtIndirectTextureProcessor. The processor then uses this in conj...
Definition: DtIndirectLimitTextureStrategy.h:65
osg::Matrixd myLocalMatrixTranformInverse
Definition: DtShaderEffectManager.h:52
Base class to provide boost signal/slot management.
std::map< osg::observer_ptr< osg::Camera >, DtShaderEffectPerChannelData * > PerChannelDataMap
Definition: DtShaderEffectManager.h:162
DtSignalConnectionManager myConnections
Definition: DtShaderEffectManager.h:154
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:70
DtOsgRenderer & myOsgRenderer
Definition: DtShaderEffectManager.h:160
PerChannelDataMap myPerChannelDataMap
Definition: DtShaderEffectManager.h:163
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22
Definition: DtShaderEffectManager.h:59

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)