DzRenderer Class Reference
[Rendering Objects]

Base class for all offline renderers. More...

Inheritance diagram for DzRenderer:

DzScriptedRenderer List of all members.

Methods

String compileShader (String shaderPath)
Boolean customRender (DzRenderHandler handler, DzCamera camera, Array lights, Array nodes, DzRenderOptions opt)
DzNode getCurrentNode ()
DtFilterFunc getFilterFunction (DzRenderOptions::PixelFilter filterType)
String getName ()
String getShaderCompilerPath ()
String getShaderExtension ()
String getShaderFileName (String shaderName)
DzShaderDescription getShaderInfo (String shaderPath)
String getShaderPath (String shaderName, Boolean withExtension=true)
Array getShaderSearchPaths ()
String getTextureUtilityPath ()
Boolean isRendering ()
void killRender ()
void prepareImage (DzTexture img, String filename)
String processShaderName (String shaderName)
Boolean render (DzRenderHandler handler, DzCamera camera, DzRenderOptions opt)

Signals

void aboutToRender (DzRenderer renderer)
 Signature: "aboutToRender(DzRenderer*)"
void imagePrepared (DzTexture img, String filename)
 Signature: "imagePrepared(const DzTexture*,const QString& )"
void renderFinished (DzRenderer renderer)
 Signature: "renderFinished(DzRenderer*)"

Detailed Description

Base class for all offline renderers.

Implements a standard RenderMan interface for the scene to render itself through an offline renderer.


Member Function Documentation

DzRenderer::aboutToRender ( DzRenderer  renderer  )  [signal]

Signature: "aboutToRender(DzRenderer*)"

Emitted when just before the renderer begins rendering

Parameters:
renderer A pointer to this renderer

String DzRenderer::compileShader ( String  shaderPath  ) 

Compiles the shader at the given path, if necessary, and returns the path to the compiled shader.

Parameters:
shaderPath The path to the shader source to compile
Returns:
The path to the compiled shader.

Boolean DzRenderer::customRender ( DzRenderHandler  handler,
DzCamera  camera,
Array  lights,
Array  nodes,
DzRenderOptions  opt 
)

Render a custom set of items.

Parameters:
handler Settings and handler for the render.
camera Camera to render from.
lights List of lights for the render.
nodes List of items to be rendered.
opt Options for this render.

DzNode DzRenderer::getCurrentNode (  ) 

Returns:
The DzNode that is currently being rendered.

DtFilterFunc DzRenderer::getFilterFunction ( DzRenderOptions::PixelFilter  filterType  ) 

This function provides a way to query the renderer for a filter function of the given type. Subclasses should override this method and return function pointers to the appropriate filters from the specific rendering engine being used.

Parameters:
filterType The type of filter to get from the renderer.
Returns:
A pointer to a function (of type DtFilterFunc) that performs the asked for filter.

String DzRenderer::getName (  ) 

Returns:
The name of this renderer.

String DzRenderer::getShaderCompilerPath (  ) 

Returns:
The path to the utility that compiles shaders for the renderer.

Reimplemented in DzScriptedRenderer.

String DzRenderer::getShaderExtension (  ) 

Returns:
The file extension that this renderer uses for compiled shaders

String DzRenderer::getShaderFileName ( String  shaderName  ) 

Given a shader name (e.g. "metal"), this method returns the file name for it by appending the shader extension for the renderer (e.g. "metal.sdl").

DzShaderDescription DzRenderer::getShaderInfo ( String  shaderPath  ) 

Gets the parameter information for the given shader. The passed shader name should be the path to the compiled shader.

String DzRenderer::getShaderPath ( String  shaderName,
Boolean  withExtension = true 
)

Given a shader name (e.g. "metal"), looks in all the shader directories attempting to find the file for it. If withExtension is true, the shader path, including the extension for the renderer is returned. Otherwise, it returns the full shader path without the extension appended. If it fails to find the shader, it returns an empty string.

Array DzRenderer::getShaderSearchPaths (  ) 

This method returns a list of paths which are used to search for shaders while rendering. It is used by the getShaderPath() method.

Returns:
A list of search paths

String DzRenderer::getTextureUtilityPath (  ) 

Returns:
The path to the utility that converts textures for the renderer.

DzRenderer::imagePrepared ( DzTexture  img,
String  filename 
) [signal]

Signature: "imagePrepared(const DzTexture*,const QString& )"

Emitted when the image preparation for img is finished. Derived classes need to make sure to emit this signal at the appropriate times.

Parameters:
img A pointer to the DzTexture object for which image preparation is complete.
filename The path to the prepared image file to be associated with img.

Boolean DzRenderer::isRendering (  ) 

Returns:
true if we are currently rendering.

void DzRenderer::killRender (  ) 

Called to kill any current render threads on this renderer.

void DzRenderer::prepareImage ( DzTexture  img,
String  filename 
)

Called by the framework to prepare/convert an image into a format that this renderer can understand/use when rendering. In derived classes, the function should result in a new image file being generated along with a path that the renderer can use to refer to the file. If the image could not be converted or is not usable by this renderer, the returned string should be empty.

Since the framework will call this function intermittently while processing other events, derived classes that need to implement this function should make it return as quickly as possible, and do the actual image preparation in separate threads or processes, in order to avoid performance problems or interface lock-ups.

After the image preparation is finished, derived classes should emit the imagePrepared() signal, passing img and the new path as parameters.

The default implementation simply emits the imagePrepared() signal with the original file name.

Parameters:
img A pointer to the DzTexture object for which the image is being prepared. This pointer acts as an identifier and must be used when emitting the imagePrepared() signal when prepartion is complete.
filename The path to the original image file that needs to be processed.

String DzRenderer::processShaderName ( String  shaderName  ) 

Processes the given shader name into a form the renderer can use (i.e. appending file extensions, finding absolute paths, etc.).

Boolean DzRenderer::render ( DzRenderHandler  handler,
DzCamera  camera,
DzRenderOptions  opt 
)

Render the current scene.

Parameters:
handler Settings and handler for the render.
camera Camera to render the scene from.
opt Options for this render.

DzRenderer::renderFinished ( DzRenderer  renderer  )  [signal]

Signature: "renderFinished(DzRenderer*)"

Emitted when just after the renderer finishes rendering

Parameters:
renderer A pointer to this renderer


Generated on Thu Sep 24 12:21:14 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.