6 #ifndef MATERIALX_GLSLMATERIAL_H
7 #define MATERIALX_GLSLMATERIAL_H
35 return std::make_shared<GlslMaterial>();
41 bool hasTransparency)
override;
53 _hwShader = std::static_pointer_cast<
GlslMaterial>(material)->_hwShader;
54 _glProgram = std::static_pointer_cast<
GlslMaterial>(material)->_glProgram;
72 bool enableMipmaps =
true)
override;
shared_ptr< class Mesh > MeshPtr
Shared pointer to a mesh.
std::shared_ptr< class Camera > CameraPtr
Shared pointer to a Camera.
virtual bool generateShader(GenContext &context)=0
void copyShader(MaterialPtr material) override
Copy shader from one material to this one.
#define MATERIALX_NAMESPACE_BEGIN
shared_ptr< class MeshPartition > MeshPartitionPtr
Shared pointer to a mesh partition.
GLsizei const GLchar *const * string
GlslProgramPtr _glProgram
shared_ptr< const Value > ConstValuePtr
A shared pointer to a const Value.
GLsizei const GLchar *const * path
virtual void bindMesh(MeshPtr mesh)=0
Bind the given mesh to this ShaderMaterial.
virtual bool bindShader() const =0
Bind shader.
MATERIALX_NAMESPACE_BEGIN MX_CORE_API const string EMPTY_STRING
virtual bool bindPartition(MeshPartitionPtr part) const =0
Bind a mesh partition to this ShaderMaterial.
virtual void unbindImages(ImageHandlerPtr imageHandler)=0
Unbbind all images for this ShaderMaterial.
virtual void drawPartition(MeshPartitionPtr part) const =0
Draw the given mesh partition.
std::shared_ptr< class GlslMaterial > GlslMaterialPtr
std::shared_ptr< class LightHandler > LightHandlerPtr
Shared pointer to a LightHandler.
virtual void bindImages(ImageHandlerPtr imageHandler, const FileSearchPath &searchPath, bool enableMipmaps=true)=0
Bind all images for this ShaderMaterial.
virtual void clearShader()=0
virtual ShaderPort * findUniform(const std::string &path) const =0
Find a public uniform from its MaterialX path.
std::shared_ptr< class GlslProgram > GlslProgramPtr
static GlslMaterialPtr create()
virtual void bindLighting(LightHandlerPtr lightHandler, ImageHandlerPtr imageHandler, const ShadowState &shadowState)=0
Bind lights to shader.
std::shared_ptr< ImageHandler > ImageHandlerPtr
Shared pointer to an ImageHandler.
virtual ImagePtr bindImage(const FilePath &filePath, const std::string &uniformName, ImageHandlerPtr imageHandler, const ImageSamplingProperties &samplingProperties)=0
Bind a single image.
#define MX_RENDERGLSL_API
GlslProgramPtr getProgram() const
Return the underlying GLSL program.
virtual void unbindGeometry()=0
Unbind all geometry from this ShaderMaterial.
virtual VariableBlock * getPublicUniforms() const =0
Return the block of public uniforms for this ShaderMaterial.
virtual void bindViewInformation(CameraPtr camera)=0
Bind viewing information for this ShaderMaterial.
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
#define MATERIALX_NAMESPACE_END
virtual bool loadSource(const FilePath &vertexShaderFile, const FilePath &pixelShaderFile, bool hasTransparency)=0
Load shader source from file.
std::shared_ptr< class ShaderMaterial > MaterialPtr
shared_ptr< Image > ImagePtr
A shared pointer to an image.
virtual void modifyUniform(const std::string &path, ConstValuePtr value, std::string valueString=EMPTY_STRING)=0
Modify the value of the uniform with the given path.
GLuint GLsizei GLsizei GLchar * uniformName