17 #include <boost/unordered_map.hpp>
19 #include <osg/StateAttribute>
45 static std::string loadShaderSource(
const std::string& strFileName);
48 static void saveShaderSource(
const std::string& strFileName,
const std::string& strSource);
50 static std::string fixVersionDirective(
const std::string &shaderString);
53 static unsigned getNumGPUTextureImageUnits();
58 static void bindSingleAttribute(
int shader,
const std::string& uniName,
bool value,
void *hashPtr);
63 static void bindAttributes(osg::Node *node,
int shader,
int contextID);
70 static bool getVPShaderVector(osg::StateSet *ss, osg::State& state,
unsigned int &shaderHash, std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector);
74 static void deleteShaders(
const std::vector<unsigned int>& shaderVector);
79 static bool compileShader(
const char* source,
unsigned int shaderType,
unsigned int &shaderID);
81 static void restoreOpenGLMode(osg::State& state,
int stateToSet);
82 static void restoreOpenGLStateAttribute(osg::State& state, osg::StateAttribute::Type type);
83 static void restoreOpenGLProgram(osg::State& state);
84 static void restoreOpenGLFBO(osg::State& state);
85 static void markAllTextureAttributesDirty(osg::State & state);
91 static void generateModelInstanceShaders(osg::Node *node,
const std::string& shaderName);