VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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. More...

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

Public Member Functions

virtual ~DtOsgShaderManager ()
 DTOR.
void setPerPixelLightingEnabled (bool enabled)
 Toggles global use of shader-based lighting effects.
bool getPerPixelLightingEnabled () const
 Retrieves whether per-pixel shader-based lighting is active.
void generateShaders (osg::Node *node, const std::string &name="", bool shareState=true, bool force=false)
 Generates virtual shader programs for a graph.
void ts_generateShaders (osg::Node *node, DtOsgFileCache &fileCache, const std::string &name="", bool shareState=true, bool force=false)
 threadsafe implementation of generateShaders
void optimizeStateSharing (osg::Node *node)
 Runs a pass over the provided graph and consolidates equivalent state attributes.
const std::string & getShaderFolderPath () const
 Gets the location of the shader sources.
void cullReset ()
 Clear the internal list of light sources and implement state changes when the cull visitor is reset each frame.
void disableShaders (osg::StateSet *stateSet)
 Disable per-pixel lighting on this state set.
osg::Texture * getOrCreateEnvironmentMapTexture ()
 An environment mapping texture that's used with reflectivity maps.
void installEnvironmentMap (osg::StateSet *stateSet)
 Installs an environment map texture/uniform on the specified state set.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtOsgShaderManagerinstance (DtDe &de)
 Get/create instance of sky object manager.
static std::string theClassName ()
 Get the name this class is registered by.

Protected Member Functions

 DtOsgShaderManager (DtDe &de)

Protected Attributes

bool myPerPixelLightingStateChanged
bool myPerPixelLightingEnabled
bool myPendingPerPixelLightingState
DtDemyDe
osg::ref_ptr< DtOpenGLCubeMapmyEnvironmentMapTexture
osg::ref_ptr
< DtOsgStateComponentContext
myStateComponentContext

Private Member Functions

 DtOsgShaderManager ()

Private Attributes

DtSignalConnectionManager myConnections

Detailed Description

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

Constructor & Destructor Documentation

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

DTOR.

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

Member Function Documentation

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

Get/create instance of sky object manager.

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

Get the name this class is registered by.

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

Toggles global use of shader-based lighting effects.

bool makVrv::DtOsgShaderManager::getPerPixelLightingEnabled ( ) const

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

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

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)

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

threadsafe implementation of generateShaders

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

Runs a pass over the provided graph and consolidates equivalent state attributes.

This can result in better draw performance by reducing OpenGL state changes

const std::string& makVrv::DtOsgShaderManager::getShaderFolderPath ( ) const

Gets the location of the shader sources.

void makVrv::DtOsgShaderManager::cullReset ( )

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

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

Disable per-pixel lighting on this state set.

osg::Texture* makVrv::DtOsgShaderManager::getOrCreateEnvironmentMapTexture ( )

An environment mapping texture that's used with reflectivity maps.

void makVrv::DtOsgShaderManager::installEnvironmentMap ( osg::StateSet *  stateSet)

Installs an environment map texture/uniform on the specified state set.

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
osg::ref_ptr<DtOsgStateComponentContext> makVrv::DtOsgShaderManager::myStateComponentContext
protected
DtSignalConnectionManager makVrv::DtOsgShaderManager::myConnections
private

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)