16 #ifndef SURGSIM_GRAPHICS_OSGSHADER_H
17 #define SURGSIM_GRAPHICS_OSGSHADER_H
21 #include <osg/Program>
22 #include <osg/StateSet>
31 class ApplicationData;
143 const std::string& name);
150 #endif // SURGSIM_GRAPHICS_OSGSHADER_H
virtual void setFragmentShaderSource(const std::string &source)
Set the fragment shader source code.
Definition: OsgShader.cpp:169
virtual void addToStateSet(osg::StateSet *stateSet)
Adds this shader to the OSG state set.
Definition: OsgShader.cpp:29
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
virtual bool loadGeometryShaderSource(const std::string &filePath)
Loads the geometry shader source code from a file.
Definition: OsgShader.cpp:109
osg::ref_ptr< osg::Program > getOsgProgram() const
Returns the OSG program attribute.
Definition: OsgShader.cpp:193
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
virtual void setGlobalScope(bool val) override
Enables the shader to override other material shaders.
Definition: OsgShader.cpp:198
virtual void clearGeometryShader()
Removes the geometry shader, returning that portion of the shader program to fixed-function.
Definition: OsgShader.cpp:100
virtual bool isGlobalScope() const override
Query if this object is global scope and overrides other lower level shaders.
Definition: OsgShader.cpp:208
virtual void setGeometryShaderSource(const std::string &source)
Set the geometry shader source code.
Definition: OsgShader.cpp:120
virtual void removeFromStateSet(osg::StateSet *stateSet)
Removes this uniform from the OSG state set.
Definition: OsgShader.cpp:38
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
virtual bool getVertexShaderSource(std::string *source) const
Gets the vertex shader source code.
Definition: OsgShader.cpp:81
virtual void clearVertexShader()
Removes the vertex shader, returning that portion of the shader program to fixed-function.
Definition: OsgShader.cpp:51
virtual void setVertexShaderSource(const std::string &source)
Set the vertex shader source code.
Definition: OsgShader.cpp:71
virtual bool hasFragmentShader() const
Returns true if the fragment shader has been set, otherwise false.
Definition: OsgShader.cpp:144
osg::ref_ptr< osg::Program > m_program
OSG program attribute.
Definition: OsgShader.h:129
virtual bool getFragmentShaderSource(std::string *source) const
Gets the fragment shader source code.
Definition: OsgShader.cpp:179
virtual bool loadFragmentShaderSource(const std::string &filePath)
Loads the fragment shader source code from a file.
Definition: OsgShader.cpp:158
virtual bool hasVertexShader() const
Returns true if the vertex shader has been set, otherwise false.
Definition: OsgShader.cpp:46
virtual bool loadVertexShaderSource(const std::string &filePath)
Loads the vertex shader source code from a file.
Definition: OsgShader.cpp:60
osg::ref_ptr< osg::Shader > m_vertexShader
OSG vertex shader.
Definition: OsgShader.h:132
virtual bool hasGeometryShader() const
Returns true if the geometry shader has been set, otherwise false.
Definition: OsgShader.cpp:95
virtual void clearFragmentShader()
Removes the fragment shader, returning that portion of the shader program to fixed-function.
Definition: OsgShader.cpp:149
OsgShader()
Constructor.
Definition: OsgShader.cpp:22
osg::ref_ptr< osg::Shader > m_fragmentShader
OSG fragment shader.
Definition: OsgShader.h:136
virtual bool getGeometryShaderSource(std::string *source) const
Gets the geometry shader source code.
Definition: OsgShader.cpp:130