HDK
|
#include <ShaderRenderer.h>
Public Types | |
enum | MatrixConvention { MatrixConvention::OpenGL = 0, MatrixConvention::Metal = 1 } |
Viewing API matrix conventions designation (default to OpenGL). More... | |
using | StageMap = StringMap |
A map with name and source code for each shader stage. More... | |
Public Member Functions | |
virtual | ~ShaderRenderer () |
Setup | |
virtual void | initialize (RenderContextHandle=nullptr) |
Initialize the renderer. More... | |
void | setCamera (CameraPtr camera) |
Set the camera. More... | |
CameraPtr | getCamera () const |
Return the camera. More... | |
void | setImageHandler (ImageHandlerPtr imageHandler) |
Set the image handler used by this renderer for image I/O. More... | |
ImageHandlerPtr | getImageHandler () const |
Return the image handler. More... | |
void | setLightHandler (LightHandlerPtr lightHandler) |
Set the light handler used by this renderer for light bindings. More... | |
LightHandlerPtr | getLightHandler () const |
Return the light handler. More... | |
void | setGeometryHandler (GeometryHandlerPtr geometryHandler) |
Set the geometry handler. More... | |
GeometryHandlerPtr | getGeometryHandler () const |
Return the geometry handler. More... | |
Rendering | |
virtual void | createProgram (ShaderPtr shader) |
Create program based on an input shader. More... | |
virtual void | createProgram (const StageMap &stages) |
virtual void | validateInputs () |
Validate inputs for the program. More... | |
virtual void | updateUniform (const string &name, ConstValuePtr value) |
Update the program with value of the uniform. More... | |
virtual void | setSize (unsigned int width, unsigned int height) |
Set the size of the rendered image. More... | |
virtual void | render () |
Render the current program to produce an image. More... | |
Utilities | |
virtual ImagePtr | captureImage (ImagePtr image=nullptr) |
Capture the current rendered output as an image. More... | |
Protected Member Functions | |
ShaderRenderer (unsigned int width, unsigned int height, Image::BaseType baseType, MatrixConvention matrixConvention=MatrixConvention::OpenGL) | |
Protected Attributes | |
unsigned int | _width |
unsigned int | _height |
Image::BaseType | _baseType |
MatrixConvention | _matrixConvention |
CameraPtr | _camera |
ImageHandlerPtr | _imageHandler |
GeometryHandlerPtr | _geometryHandler |
LightHandlerPtr | _lightHandler |
Base class for renderers that generate shader code to produce images.
Definition at line 30 of file ShaderRenderer.h.
using ShaderRenderer::StageMap = StringMap |
A map with name and source code for each shader stage.
Definition at line 40 of file ShaderRenderer.h.
|
strong |
Viewing API matrix conventions designation (default to OpenGL).
Enumerator | |
---|---|
OpenGL | |
Metal |
Definition at line 34 of file ShaderRenderer.h.
|
inlinevirtual |
Definition at line 43 of file ShaderRenderer.h.
|
protected |
Capture the current rendered output as an image.
Reimplemented in GlslRenderer, and OslRenderer.
Definition at line 127 of file ShaderRenderer.h.
Create program based on an input shader.
Reimplemented in GlslRenderer, and OslRenderer.
Create program based on shader stage source code.
stages | Map of name and source code for the shader stages. |
Reimplemented in GlslRenderer, and OslRenderer.
|
inline |
Return the camera.
Definition at line 58 of file ShaderRenderer.h.
|
inline |
Return the geometry handler.
Definition at line 94 of file ShaderRenderer.h.
|
inline |
Return the image handler.
Definition at line 70 of file ShaderRenderer.h.
|
inline |
Return the light handler.
Definition at line 82 of file ShaderRenderer.h.
|
inlinevirtual |
Initialize the renderer.
Reimplemented in GlslRenderer, and OslRenderer.
Definition at line 49 of file ShaderRenderer.h.
|
inlinevirtual |
Render the current program to produce an image.
Reimplemented in GlslRenderer, and OslRenderer.
Definition at line 120 of file ShaderRenderer.h.
Set the camera.
Definition at line 52 of file ShaderRenderer.h.
|
inline |
Set the geometry handler.
Definition at line 88 of file ShaderRenderer.h.
|
inline |
Set the image handler used by this renderer for image I/O.
Definition at line 64 of file ShaderRenderer.h.
|
inline |
Set the light handler used by this renderer for light bindings.
Definition at line 76 of file ShaderRenderer.h.
Set the size of the rendered image.
Reimplemented in GlslRenderer, and OslRenderer.
|
virtual |
Update the program with value of the uniform.
Reimplemented in GlslRenderer.
|
inlinevirtual |
Validate inputs for the program.
Reimplemented in GlslRenderer, and OslRenderer.
Definition at line 111 of file ShaderRenderer.h.
|
protected |
Definition at line 141 of file ShaderRenderer.h.
|
protected |
Definition at line 145 of file ShaderRenderer.h.
|
protected |
Definition at line 147 of file ShaderRenderer.h.
|
protected |
Definition at line 140 of file ShaderRenderer.h.
|
protected |
Definition at line 146 of file ShaderRenderer.h.
|
protected |
Definition at line 148 of file ShaderRenderer.h.
|
protected |
Definition at line 143 of file ShaderRenderer.h.
|
protected |
Definition at line 139 of file ShaderRenderer.h.