User Tools

Site Tools


DzRenderer

Base class for all offline renderers.

More...

Inherits :

Inherited By : DzDelightRenderer, DzIrayRenderer and DzScriptedRenderer

Methods

Signals

voidaboutToRender ( DzRenderer renderer )
voidimagePrepared ( DzTexture img, String filename )
voidIPRRenderHandlerChanged ( DzRenderer renderer, iprrenderhandler_dz handler )
voidrendererModeChanged ( DzRenderer renderer )
voidrenderFinished ( DzRenderer renderer )
voidshapeRenderBeginning ( shape_dz shape )
voidshapeRenderFinished ( shape_dz shape )

Detailed Description

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

Methods


String : compileShader( String shaderPath )

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

Parameter(s):

  • shaderPath - The path to the shader source to compile

Return Value:

  • The path to the compiled shader.

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

Render a custom set of items.

Parameter(s):

  • 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.

Return Value:

  • true if rendering was successful. false if rendering was canceled by user or there were errors during the render.

DzNode : getCurrentNode()

Return Value:

  • The DzNode that is currently being rendered.

iprrenderhandler_dz : getIPRRenderHandler()

Return Value:

  • The handler used for Interactive Progressive Rendering (IPR) on this renderer (if any). NULL if this renderer does not support IPR.

String : getName()

Return Value:

  • The name of this renderer.

DzRendererMode : getRendererMode()

Return Value:

  • The renderer mode (feature set) for this renderer.

String : getShaderCompilerPath()

Return Value:

  • The path to the utility that compiles shaders for the renderer.

String : getShaderExtension()

Return Value:

  • The file extension that this renderer uses for compiled shaders

String : 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 : getShaderInfo( String shaderPath )

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


String : 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 : getShaderSearchPaths()

Return Value:

  • A list of paths which are used to search for shaders while rendering.

See Also:


String : getTextureUtilityPath()

Return Value:

  • The path to the utility that converts textures for the renderer.

Boolean : isRendering()

Return Value:

  • true if the application is currently rendering, otherwise false.

void : killRender()

Stops the render.


void : 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.

Parameter(s):

  • img - The DzTexture object for which the image is being prepared.
  • filename - The path to the original image file that needs to be processed.

See Also:


String : 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 : render( DzRenderHandler handler, DzCamera camera, DzRenderOptions opt )

Render the current scene.

Parameter(s):

  • handler - Settings and handler for the render.
  • camera - Camera to render the scene from.
  • opt - Options for this render.

Return Value:

  • true if rendering was successful. false if rendering was canceled by user or there were errors during the render.

void : saveBakeImage( DzBakerOptions opt, Boolean wait )

Converts a .bake file into an image file.

Parameter(s):

  • opt - Shader baker options.
  • wait - If true, this method is exited only when the conversion has ended. If false the method returns immediately after starting conversion; the baker's saveFileFinished() slot will be invoked after the conversion finishes.

void : setIPRRenderHandler( iprrenderhandler_dz handler )

Sets the handler used for Interactive Progressive Rendering (IPR) on this renderer.

Parameter(s):

  • handler - The render handler to set.

void : stopBaking()

Stops an active baking operation, if possible.


Boolean : textureConvert( DzRenderHandler handler, DzCamera camera, DzTextureConvertorOptions opt )

Performs texture conversion.

Parameter(s):

  • handler - The render handler to use for the conversion.
  • camera - The camera to use for the conversion.
  • opt - The options to use in the conversion.

Return Value:

  • true if the conversion succeeds, false if the conversion is cancelled or in case of error.

Signals


void : aboutToRender( DzRenderer renderer )

Signature:“aboutToRender(DzRenderer*)”

Emitted when just before the renderer begins rendering

Parameter(s):

  • renderer - A pointer to this renderer

void : imagePrepared( DzTexture img, String filename )

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.

Parameter(s):

  • 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.

void : IPRRenderHandlerChanged( DzRenderer renderer, iprrenderhandler_dz handler )

TODO: Add description.


void : rendererModeChanged( DzRenderer renderer )

TODO: Add description.


void : renderFinished( DzRenderer renderer )

Signature:“renderFinished(DzRenderer*)”

Emitted when just after the renderer finishes rendering

Parameter(s):

  • renderer - A pointer to this renderer

void : shapeRenderBeginning( shape_dz shape )

TODO: Add description.


void : shapeRenderFinished( shape_dz shape )

TODO: Add description.