VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShaderEffect.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 
16 
18 
19 #include <matrix/vlVector.h>
20 
21 #include <string>
22 #include <vector>
23 
24 #include <osg/Texture>
25 #include <osg/Uniform>
26 #include <osg/ref_ptr>
27 
28 namespace osg
29 {
30  class GraphicsContext;
31 }
32 
33 namespace makVrv
34 {
35  class DtOsgWeatherEffectsObject;
36  class DtIndirectTexturePrototype;
37  class DtIndirectGlTextureObjectManager;
38 
43  {
44  public:
45 
48  {
49  public:
52  const DtIndirectTexturePrototype* myVrvTexture = nullptr;
53  GLuint64 myTextureAddress = 0;
54  };
55 
56  typedef std::vector<DtShaderEffectTextureData> TextureDataPtrVector;
57 
58  public:
60  virtual ~DtShaderEffect();
61 
63  DtShaderEffect() = delete;
65  DtShaderEffect(const DtShaderEffect&) = delete;
67  DtShaderEffect &operator=(const DtShaderEffect&) = delete;
68 
69  protected:
71  DtShaderEffect(DtDe& de);
72 
73  public:
76  virtual void initializeEffect(const std::vector<osg::StateSet*>& statesets);
77 
79  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject) = 0;
80 
82  virtual void updateTextureUniforms();
83 
85  virtual void setCameraLocation(const DtVector& location);
86 
89  virtual void setWindSpeed(float speed);
90 
93  virtual void setWindDirection(float direction);
94 
96  virtual void setEffectDirty(bool dirty);
97 
99  virtual bool effectDirty();
100 
102  virtual void updateImGui() = 0;
103 
105  virtual void updateUniforms() = 0;
106 
108  virtual void releaseGLObjects(osg::State* state);
109 
110  protected:
111 
113  virtual int loadShaderEffectTexture(const std::string& filename, const std::string& uniformName);
114 
116  virtual int addShaderEffectTexture(osg::Texture* shaderEffectTexture
117  , const DtIndirectTexturePrototype* vrvTexture, const std::string& uniformName);
118 
119  protected:
120 
122 
124 
126 
128 
130  };
131 }
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:91
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtShaderEffect injects custom shaders into the scenes, There are derrived classes of this for snow an...
Definition: DtShaderEffect.h:42
Structure for holding per texture data for bindless textures.
Definition: DtShaderEffect.h:47
TextureDataPtrVector myShaderEffectTextures
Definition: DtShaderEffect.h:123
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
This manager manages the lifetime of the actual gl texture objects (gl unsigned ints) in the indirect...
Definition: DtIndirectGlTextureObjectManager.h:60
DtDe & myDe
Definition: DtShaderEffect.h:121
bool myEffectDirty
Definition: DtShaderEffect.h:125
DtOsgRenderer & myOsgRenderer
Definition: DtShaderEffect.h:129
Contains makVrv::DtVirtualBaseClass class.
DtIndirectGlTextureObjectManager & myIndirectGlTextureObjectManager
Definition: DtShaderEffect.h:127
osg::ref_ptr< osg::Uniform > myUniform
Definition: DtShaderEffect.h:51
osg::ref_ptr< osg::Texture > myTexture
Definition: DtShaderEffect.h:50
Contains makVrv::DtShaderEffectManager class.
Base class to provide boost signal/slot management.
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
std::vector< DtShaderEffectTextureData > TextureDataPtrVector
Definition: DtShaderEffect.h:56
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22

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)