VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgShaderManager.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 
13 #include <vrvOsg/vrvOsg.h>
14 
15 #include <osg/ref_ptr>
16 #include <osg/Camera>
17 
18 #include <string>
19 
22 
23 #include <boost/thread/shared_mutex.hpp>
24 
25 namespace osg
26 {
27  class Node;
28  class StateSet;
29  class Texture;
30 }
31 
32 namespace makVrv
33 {
34  class DtOpenGLCubeMap;
35  class DtOsgFileCache;
36 
42  {
43  public:
45  static DtOsgShaderManager& instance(DtDe& de);
46 
48  virtual ~DtOsgShaderManager();
49 
51  static std::string theClassName();
52  protected:
55  private:
57  DtOsgShaderManager() = delete;
59  DtOsgShaderManager(const DtOsgShaderManager&) = delete;
61  DtOsgShaderManager operator=(const DtOsgShaderManager&) = delete;
62  public:
63 
65  virtual void setPerPixelLightingEnabled(bool enabled);
66 
68  virtual bool getPerPixelLightingEnabled() const;
69 
77  virtual void generateShaders(osg::Node* node, const std::string& name = "", bool shareState = true, bool force = false);
78 
80  virtual void ts_generateShaders(osg::Node* node, DtOsgFileCache& fileCache, const std::string& name = "", bool shareState = true, bool force = false);
81 
84  virtual void removeShaders(osg::Node* node);
85 
87  virtual void ts_removeShaders(osg::Node* node);
88 
91  virtual void optimizeStateSharing(osg::Node* node);
92 
94  virtual const std::string& shaderFolderPath() const;
95 
97  virtual void disableShaders(osg::StateSet *stateSet);
98 
101  virtual void installEnvironmentMap(osg::Camera* camera);
102 
106  boost::shared_mutex& optimizeStateSetMutex();;
107 
108  protected:
112 
114 
116 
117  std::string myShaderFolderPath;
118 
119  boost::shared_mutex myOptimizeStateSetMutex;
120 
121  private:
123  };
124 }
boost::shared_mutex myOptimizeStateSetMutex
Definition: DtOsgShaderManager.h:119
bool myPerPixelLightingEnabled
Definition: DtOsgShaderManager.h:110
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
bool myPendingPerPixelLightingState
Definition: DtOsgShaderManager.h:111
osg::ref_ptr< DtOpenGLCubeMap > myEnvironmentMapTexture
Definition: DtOsgShaderManager.h:115
std::string myShaderFolderPath
Definition: DtOsgShaderManager.h:117
Contains makVrv::DtVirtualBaseClass class.
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:56
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtSignalConnectionManager myConnections
Definition: DtOsgShaderManager.h:122
DtOsgShaderManager injects custom shaders into the scenes, and keeps their uniform parameters set to ...
Definition: DtOsgShaderManager.h:41
Base class to provide boost signal/slot management.
bool myPerPixelLightingStateChanged
Definition: DtOsgShaderManager.h:106
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:72
DtDe & myDe
Definition: DtOsgShaderManager.h:113

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)