![]() |
VR-Forces Developer's Guide
|
Miscellaneous shader utilities for osg.
Static Public Member Functions | |
| static bool | getVPShaderVector (osg::StateSet *ss, osg::State &state, unsigned int &shaderHash, std::vector< unsigned int > &vertShaderVector, std::vector< unsigned int > &fragShaderVector, bool skipShadowShaders, bool skipMultiViewShaders) |
| static bool | addDegenerateShadersIfNeeded (osg::StateSet *ss, osg::State &state, std::vector< unsigned int > &vertShaderVector, std::vector< unsigned int > &fragShaderVector, bool skip_shadow_shaders=false) |
| static void | restoreEverything (osg::State &state) |
| static void | restoreOpenGLMode (const osg::State &state, int stateToSet) |
| static void | restoreOpenGLStateAttribute (osg::State &state, osg::StateAttribute::Type type) |
| static void | restoreOpenGLProgram (const osg::State &state) |
| static void | restoreOpenGLFBO (const osg::State &state) |
| static void | markAllTextureAttributesDirty (osg::State &state) |
| static void | generateModelInstanceShaders (osg::Node *node, const std::string &shaderName) |
Private Member Functions | |
| DtOsgShaderUtils ()=delete | |
| DtOsgShaderUtils (const DtOsgShaderUtils &rhs)=delete | |
| DtOsgShaderUtils & | operator= (const DtOsgShaderUtils &rhs)=delete |
| virtual | ~DtOsgShaderUtils ()=delete |
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
privatevirtualdelete |
not allowed
|
privatedelete |
not allowed
|
static |
Collect all the active osg::Shader objects in the provided State and compile them. If they compile, they are pushed onto shaderVector. shaderVector is cleared in this function so only the shaders from the State are kept. The stateset "ss" is then cleared of an update mark. Returns True if the ss was marked for an update and the shaderVector was modified.
|
static |
adds a degenerate shadow shader
|
static |
|
static |
restore the OpenGL mode of the state
|
static |
restore the OpenGL state attribute
|
static |
restore the OpenGL program
|
static |
restore the OpenGL fbo
|
static |
mark dirty
|
static |
utility function for generating shaders for vrvOsg model instances simpler than the DtOsgShaderManager::generateShaders in that it doesn't share the statesets and just runs the osgEarth::ShaderGenerator on the node. This was created solely for the purpose of removing duplicate code for model instances to setup their shaders.