6#ifndef MATERIALX_GLSLMATERIAL_H
7#define MATERIALX_GLSLMATERIAL_H
18MATERIALX_NAMESPACE_BEGIN
20using GlslMaterialPtr = std::shared_ptr<class GlslMaterial>;
33 static GlslMaterialPtr create()
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;
79 const std::string& uniformName,
109 std::string valueString = EMPTY_STRING)
override;
112 void clearShader()
override;
115 GlslProgramPtr _glProgram;
118MATERIALX_NAMESPACE_END
shared_ptr< Image > ImagePtr
A shared pointer to an image.
Definition: Image.h:23
std::shared_ptr< ImageHandler > ImageHandlerPtr
Shared pointer to an ImageHandler.
Definition: ImageHandler.h:32
std::shared_ptr< class LightHandler > LightHandlerPtr
Shared pointer to a LightHandler.
Definition: LightHandler.h:25
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
Definition: Library.h:34
shared_ptr< class MeshPartition > MeshPartitionPtr
Shared pointer to a mesh partition.
Definition: Mesh.h:146
shared_ptr< class Mesh > MeshPtr
Shared pointer to a mesh.
Definition: Mesh.h:230
ShaderMaterial helper classes.
shared_ptr< const Value > ConstValuePtr
A shared pointer to a const Value.
Definition: Value.h:31
A generic file path, supporting both syntactic and file system operations.
Definition: File.h:27
A sequence of file paths, which may be queried to find the first instance of a given filename on the ...
Definition: File.h:219
A context class for shader generation.
Definition: GenContext.h:31
Helper class for GLSL generation and rendering of a material.
Definition: GlslMaterial.h:25
void bindViewInformation(CameraPtr camera) override
Bind viewing information for this material.
void bindImages(ImageHandlerPtr imageHandler, const FileSearchPath &searchPath, bool enableMipmaps=true) override
Bind all images for this material.
ShaderPort * findUniform(const std::string &path) const override
Find a public uniform from its MaterialX path.
void unbindImages(ImageHandlerPtr imageHandler) override
Unbbind all images for this material.
bool bindPartition(MeshPartitionPtr part) const override
Bind a mesh partition to this material.
bool loadSource(const FilePath &vertexShaderFile, const FilePath &pixelShaderFile, bool hasTransparency) override
Load shader source from file.
void modifyUniform(const std::string &path, ConstValuePtr value, std::string valueString=EMPTY_STRING) override
Modify the value of the uniform with the given path.
ImagePtr bindImage(const FilePath &filePath, const std::string &uniformName, ImageHandlerPtr imageHandler, const ImageSamplingProperties &samplingProperties) override
Bind a single image.
void bindLighting(LightHandlerPtr lightHandler, ImageHandlerPtr imageHandler, const ShadowState &shadowState) override
Bind lights to shader.
VariableBlock * getPublicUniforms() const override
Return the block of public uniforms for this material.
GlslProgramPtr getProgram() const
Return the underlying GLSL program.
Definition: GlslMaterial.h:58
void drawPartition(MeshPartitionPtr part) const override
Draw the given mesh partition.
bool bindShader() const override
Bind shader.
bool generateShader(ShaderPtr hwShader) override
Generate a shader from the given hardware shader.
void unbindGeometry() override
Unbind all geometry from this material.
void copyShader(MaterialPtr material) override
Copy shader from one material to this one.
Definition: GlslMaterial.h:51
void bindMesh(MeshPtr mesh) override
Bind the given mesh to this material.
bool generateShader(GenContext &context) override
Generate a shader from our currently stored element and the given generator context.
Interface to describe sampling properties for images.
Definition: ImageHandler.h:43
Abstract class for shader generation and rendering of a ShaderMaterial.
Definition: ShaderMaterial.h:40
An input or output port on a ShaderNode.
Definition: ShaderNode.h:123
Helper class representing shadow rendering state.
Definition: ShaderMaterial.h:29
A block of variables in a shader stage.
Definition: ShaderStage.h:61