VR-Forces 5.0.1 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) 2020 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 
98  virtual void cullReset();
99 
101  virtual void disableShaders(osg::StateSet *stateSet);
102 
105  virtual void installEnvironmentMap(osg::Camera* camera);
106 
110  boost::shared_mutex& optimizeStateSetMutex();;
111 
112  protected:
116 
118 
120 
121  std::string myShaderFolderPath;
122 
123  boost::shared_mutex myOptimizeStateSetMutex;
124 
125  private:
127  };
128 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
boost::shared_mutex myOptimizeStateSetMutex
Definition: DtOsgShaderManager.h:123
bool myPerPixelLightingEnabled
Definition: DtOsgShaderManager.h:114
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:115
osg::ref_ptr< DtOpenGLCubeMap > myEnvironmentMapTexture
Definition: DtOsgShaderManager.h:119
std::string myShaderFolderPath
Definition: DtOsgShaderManager.h:121
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:54
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtSignalConnectionManager myConnections
Definition: DtOsgShaderManager.h:126
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:110
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
DtDe & myDe
Definition: DtOsgShaderManager.h:117

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)