VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
makVrv::DtOsgShaderManager Class Reference

DtOsgShaderManager injects custom shaders into the scenes, and keeps their uniform parameters set to match fixed function pipeline capabilities as much as possible.

Inheritance diagram for makVrv::DtOsgShaderManager:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtOsgShaderManager ()
 
virtual void setPerPixelLightingEnabled (bool enabled)
 
virtual bool getPerPixelLightingEnabled () const
 
virtual void generateShaders (osg::Node *node, const std::string &name="", bool shareState=true, bool force=false)
 
virtual void ts_generateShaders (osg::Node *node, DtOsgFileCache &fileCache, const std::string &name="", bool shareState=true, bool force=false)
 
virtual void removeShaders (osg::Node *node)
 
virtual void ts_removeShaders (osg::Node *node)
 
virtual void optimizeStateSharing (osg::Node *node)
 
virtual const std::string & shaderFolderPath () const
 
virtual void cullReset ()
 
virtual void disableShaders (osg::StateSet *stateSet)
 
virtual void installEnvironmentMap (osg::Camera *camera)
 
boost::shared_mutex & optimizeStateSetMutex ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtOsgShaderManagerinstance (DtDe &de)
 
static std::string theClassName ()
 

Protected Member Functions

 DtOsgShaderManager (DtDe &de)
 

Protected Attributes

bool myPerPixelLightingStateChanged
 
bool myPerPixelLightingEnabled
 
bool myPendingPerPixelLightingState
 
DtDemyDe
 
osg::ref_ptr< DtOpenGLCubeMapmyEnvironmentMapTexture
 
std::string myShaderFolderPath
 
boost::shared_mutex myOptimizeStateSetMutex
 

Private Member Functions

 DtOsgShaderManager ()=delete
 
 DtOsgShaderManager (const DtOsgShaderManager &)=delete
 
DtOsgShaderManager operator= (const DtOsgShaderManager &)=delete
 

Private Attributes

DtSignalConnectionManager myConnections
 

Constructor & Destructor Documentation

virtual makVrv::DtOsgShaderManager::~DtOsgShaderManager ( )
virtual

DTOR.

makVrv::DtOsgShaderManager::DtOsgShaderManager ( DtDe de)
protected

can only create using instance()

makVrv::DtOsgShaderManager::DtOsgShaderManager ( )
privatedelete

not allowed

makVrv::DtOsgShaderManager::DtOsgShaderManager ( const DtOsgShaderManager )
privatedelete

not allowed

Member Function Documentation

static DtOsgShaderManager& makVrv::DtOsgShaderManager::instance ( DtDe de)
static

Get/create instance of shader manager.

static std::string makVrv::DtOsgShaderManager::theClassName ( )
static

Get the name this class is registered by.

DtOsgShaderManager makVrv::DtOsgShaderManager::operator= ( const DtOsgShaderManager )
privatedelete

not allowed

virtual void makVrv::DtOsgShaderManager::setPerPixelLightingEnabled ( bool  enabled)
virtual

Toggles global use of shader-based lighting effects.

virtual bool makVrv::DtOsgShaderManager::getPerPixelLightingEnabled ( ) const
virtual

Retrieves whether per-pixel shader-based lighting is active.

virtual void makVrv::DtOsgShaderManager::generateShaders ( osg::Node *  node,
const std::string &  name = "",
bool  shareState = true,
bool  force = false 
)
virtual

Generates virtual shader programs for a graph. node: Graph for which to generate shader components name: Optional name to give to virtual programs (useful for debugging) shareState: Run a pass on the node to share equivalent state attributes. This is equivalent to calling optimizeStateSharing(node) after calling this. force: Force shader generation on the node graph, disregarding the ignore userdata flag (see osgEarth::ShaderGenerator::setIgnoreHint)

virtual void makVrv::DtOsgShaderManager::ts_generateShaders ( osg::Node *  node,
DtOsgFileCache fileCache,
const std::string &  name = "",
bool  shareState = true,
bool  force = false 
)
virtual

threadsafe implementation of generateShaders

virtual void makVrv::DtOsgShaderManager::removeShaders ( osg::Node *  node)
virtual

Remove virtual shader programs for a graph. node: Graph for which to remove shader components.

virtual void makVrv::DtOsgShaderManager::ts_removeShaders ( osg::Node *  node)
virtual

threadsafe implementation of removeShaders

virtual void makVrv::DtOsgShaderManager::optimizeStateSharing ( osg::Node *  node)
virtual

Runs a pass over the provided graph and consolidates equivalent state attributes. This can result in better draw performance by reducing OpenGL state changes.

virtual const std::string& makVrv::DtOsgShaderManager::shaderFolderPath ( ) const
virtual

Gets the location of the shader sources.

virtual void makVrv::DtOsgShaderManager::cullReset ( )
virtual

Clear the internal list of light sources and implement state changes when the cull visitor is reset each frame.

virtual void makVrv::DtOsgShaderManager::disableShaders ( osg::StateSet *  stateSet)
virtual

Disable per-pixel lighting on this state set.

virtual void makVrv::DtOsgShaderManager::installEnvironmentMap ( osg::Camera *  camera)
virtual

Installs an environment map texture/uniform on the specified camera. This needs to be per camera so that the correct environment map is used based on the camera.

boost::shared_mutex& makVrv::DtOsgShaderManager::optimizeStateSetMutex ( )

get the optimize stateset mutex, used by DtOsgEarthFeatureDataBroker and DtIndirectGeometryRegistry to avoid both running their visitors at the same time this should go away once we refactor the DtIndirectRegistry stuff enough to fix this problem.

Member Data Documentation

bool makVrv::DtOsgShaderManager::myPerPixelLightingStateChanged
protected
bool makVrv::DtOsgShaderManager::myPerPixelLightingEnabled
protected
bool makVrv::DtOsgShaderManager::myPendingPerPixelLightingState
protected
DtDe& makVrv::DtOsgShaderManager::myDe
protected
osg::ref_ptr<DtOpenGLCubeMap> makVrv::DtOsgShaderManager::myEnvironmentMapTexture
protected
std::string makVrv::DtOsgShaderManager::myShaderFolderPath
protected
boost::shared_mutex makVrv::DtOsgShaderManager::myOptimizeStateSetMutex
protected
DtSignalConnectionManager makVrv::DtOsgShaderManager::myConnections
private

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)