6#ifndef MATERIALX_SHADERRENDERER_H
7#define MATERIALX_SHADERRENDERER_H
12#include <MaterialXRender/Camera.h>
19MATERIALX_NAMESPACE_BEGIN
66 _imageHandler = imageHandler;
78 _lightHandler = lightHandler;
90 _geometryHandler = geometryHandler;
96 return _geometryHandler;
117 virtual void setSize(
unsigned int width,
unsigned int height);
135 ShaderRenderer(
unsigned int width,
unsigned int height, Image::BaseType baseType,
136 MatrixConvention matrixConvention = MatrixConvention::OpenGL);
140 unsigned int _height;
141 Image::BaseType _baseType;
143 MatrixConvention _matrixConvention;
166 _errorLog(e._errorLog)
172 Exception::operator=(e);
173 _errorLog = e._errorLog;
186MATERIALX_NAMESPACE_END
Geometry loader interfaces.
std::shared_ptr< class GeometryHandler > GeometryHandlerPtr
Shared pointer to an GeometryHandler.
Definition: GeometryHandler.h:55
shared_ptr< Image > ImagePtr
A shared pointer to an image.
Definition: Image.h:23
Image handler interfaces.
std::shared_ptr< ImageHandler > ImageHandlerPtr
Shared pointer to an ImageHandler.
Definition: ImageHandler.h:32
Handler for hardware lights.
std::shared_ptr< class LightHandler > LightHandlerPtr
Shared pointer to a LightHandler.
Definition: LightHandler.h:25
vector< string > StringVec
A vector of strings.
Definition: Library.h:55
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
Definition: Library.h:57
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
Definition: Library.h:34
Shader instance class created during shader generation.
void * RenderContextHandle
Render context handle Provides a provision for an application to share any renderer specific settings...
Definition: ShaderRenderer.h:23
std::shared_ptr< class ShaderRenderer > ShaderRendererPtr
Shared pointer to a shader renderer.
Definition: ShaderRenderer.h:26
shared_ptr< const Value > ConstValuePtr
A shared pointer to a const Value.
Definition: Value.h:31
The base class for exceptions that are propagated from the MaterialX library to the client applicatio...
Definition: Exception.h:22
An exception that is thrown when a rendering operation fails.
Definition: ShaderRenderer.h:156
Base class for renderers that generate shader code to produce images.
Definition: ShaderRenderer.h:31
virtual void createProgram(const StageMap &stages)
Create program based on shader stage source code.
virtual ImagePtr captureImage(ImagePtr image=nullptr)
Capture the current rendered output as an image.
Definition: ShaderRenderer.h:127
virtual void render()
Render the current program to produce an image.
Definition: ShaderRenderer.h:120
void setImageHandler(ImageHandlerPtr imageHandler)
Set the image handler used by this renderer for image I/O.
Definition: ShaderRenderer.h:64
void setLightHandler(LightHandlerPtr lightHandler)
Set the light handler used by this renderer for light bindings.
Definition: ShaderRenderer.h:76
virtual void validateInputs()
Validate inputs for the program.
Definition: ShaderRenderer.h:111
void setGeometryHandler(GeometryHandlerPtr geometryHandler)
Set the geometry handler.
Definition: ShaderRenderer.h:88
GeometryHandlerPtr getGeometryHandler() const
Return the geometry handler.
Definition: ShaderRenderer.h:94
ImageHandlerPtr getImageHandler() const
Return the image handler.
Definition: ShaderRenderer.h:70
MatrixConvention
Viewing API matrix conventions designation (default to OpenGL).
Definition: ShaderRenderer.h:35
virtual void setSize(unsigned int width, unsigned int height)
Set the size of the rendered image.
void setCamera(CameraPtr camera)
Set the camera.
Definition: ShaderRenderer.h:52
virtual void createProgram(ShaderPtr shader)
Create program based on an input shader.
CameraPtr getCamera() const
Return the camera.
Definition: ShaderRenderer.h:58
LightHandlerPtr getLightHandler() const
Return the light handler.
Definition: ShaderRenderer.h:82
virtual void updateUniform(const string &name, ConstValuePtr value)
Update the program with value of the uniform.
StringMap StageMap
A map with name and source code for each shader stage.
Definition: ShaderRenderer.h:40
virtual void initialize(RenderContextHandle=nullptr)
Initialize the renderer.
Definition: ShaderRenderer.h:49