16 #ifndef SURGSIM_GRAPHICS_OSGMATERIAL_H 17 #define SURGSIM_GRAPHICS_OSGMATERIAL_H 21 #include <osg/Material> 22 #include <osg/StateSet> 55 virtual bool addUniform(std::shared_ptr<UniformBase> uniform)
override;
63 virtual bool removeUniform(std::shared_ptr<UniformBase> uniform)
override;
69 virtual std::shared_ptr<UniformBase>
getUniform(
size_t index)
const override;
79 virtual bool setShader(std::shared_ptr<Shader> shader)
override;
81 virtual std::shared_ptr<Shader>
getShader()
const override;
107 #endif // SURGSIM_GRAPHICS_OSGMATERIAL_H virtual size_t getNumUniforms() const override
Returns the number of uniforms in this material.
Definition: OsgMaterial.cpp:112
osg::ref_ptr< osg::StateSet > m_stateSet
OSG state set which provides material properties in the scenegraph.
Definition: OsgMaterial.h:94
Definition: DriveElementFromInputBehavior.cpp:27
virtual std::shared_ptr< Shader > getShader() const override
Gets the shader used by this material.
Definition: OsgMaterial.cpp:183
virtual bool removeUniform(std::shared_ptr< UniformBase > uniform) override
Removes a uniform from this material.
Definition: OsgMaterial.cpp:85
std::vector< std::shared_ptr< OsgUniformBase > > m_uniforms
Uniforms used by this material.
Definition: OsgMaterial.h:97
virtual bool setShader(std::shared_ptr< Shader > shader) override
Sets the shader used by this material.
Definition: OsgMaterial.cpp:164
virtual bool addUniform(std::shared_ptr< UniformBase > uniform) override
Adds a uniform to this material.
Definition: OsgMaterial.cpp:45
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
Base class that defines the interface for graphics materials.
Definition: Material.h:39
virtual bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: OsgMaterial.cpp:206
virtual std::shared_ptr< UniformBase > getUniform(size_t index) const override
Gets a uniform in this material.
Definition: OsgMaterial.cpp:117
virtual bool hasUniform(const std::string &name) const override
Checks if this material has a uniform with the given name.
Definition: OsgMaterial.cpp:159
std::shared_ptr< OsgShader > m_shader
Shader used by this material.
Definition: OsgMaterial.h:100
virtual void clearShader() override
Removes the shader from the material, falling back to fixed-function pipeline.
Definition: OsgMaterial.cpp:188
osg::ref_ptr< osg::StateSet > getOsgStateSet() const
Definition: OsgMaterial.cpp:211
OsgMaterial(const std::string &name)
Constructor.
Definition: OsgMaterial.cpp:38
OSG-based implementation of a graphics material.
Definition: OsgMaterial.h:44
virtual bool doInitialize() override
Interface to be implemented by derived classes.
Definition: OsgMaterial.cpp:197