16 #ifndef SURGSIM_GRAPHICS_OSGSHADER_H 17 #define SURGSIM_GRAPHICS_OSGSHADER_H 21 #include <osg/Program> 22 #include <osg/StateSet> 31 class ApplicationData;
51 virtual void addToStateSet(osg::StateSet* stateSet);
55 virtual void removeFromStateSet(osg::StateSet* stateSet);
58 virtual bool hasVertexShader()
const;
61 virtual void clearVertexShader();
66 virtual bool loadVertexShaderSource(
const std::string& filePath);
70 virtual void setVertexShaderSource(
const std::string& source);
74 virtual bool getVertexShaderSource(
std::string* source)
const;
77 virtual bool hasGeometryShader()
const;
80 virtual void clearGeometryShader();
85 virtual bool loadGeometryShaderSource(
const std::string& filePath);
89 virtual void setGeometryShaderSource(
const std::string& source);
93 virtual bool getGeometryShaderSource(
std::string* source)
const;
97 virtual bool hasFragmentShader()
const;
100 virtual void clearFragmentShader();
105 virtual bool loadFragmentShaderSource(
const std::string& filePath);
109 virtual void setFragmentShaderSource(
const std::string& source);
113 virtual bool getFragmentShaderSource(
std::string* source)
const;
116 osg::ref_ptr<osg::Program> getOsgProgram()
const;
120 virtual void setGlobalScope(
bool val)
override;
124 virtual bool isGlobalScope()
const override;
150 #endif // SURGSIM_GRAPHICS_OSGSHADER_H Definition: DriveElementFromInputBehavior.cpp:27
OSG-based implementation of a graphics shader.
Definition: OsgShader.h:42
Enable searching for files in a given list of paths, give access to the current directory and wrap bo...
Definition: ApplicationData.h:39
std::shared_ptr< SurgSim::Graphics::OsgShader > loadShader(const SurgSim::Framework::ApplicationData &data, const std::string &name)
Definition: OsgShader.cpp:213
bool m_globalScope
Is the shader supposed to be used globally.
Definition: OsgShader.h:139
osg::ref_ptr< osg::Shader > m_geometryShader
OSG geometry shader.
Definition: OsgShader.h:134
Base class that defines the interface for graphics shaders.
Definition: Shader.h:30
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
osg::ref_ptr< osg::Program > m_program
OSG program attribute.
Definition: OsgShader.h:129
osg::ref_ptr< osg::Shader > m_vertexShader
OSG vertex shader.
Definition: OsgShader.h:132
osg::ref_ptr< osg::Shader > m_fragmentShader
OSG fragment shader.
Definition: OsgShader.h:136