User Tools

Site Tools


DzShaderCamera

Custom scriptable class for cameras using RenderMan Shader Language (RSL) Shaders.

More...

Inherits :

Constructors

DAZ Script
DzShaderCamera ()
DzShaderCamera ( String definitionFile, String renderTimeFile )
DzShaderCamera ( String definitionFile )

Methods

DAZ Script
BooleanaddShader ( DzRSLShader shader )
StringgetCameraName ()
StringgetDefinitionFile ()
NumbergetNumShaders ()
StringgetRenderTimeFile ()
DzRSLShadergetShader ( Number index )
BooleanremoveShader ( DzRSLShader shader )
voidsetCameraName ( String name )
voidsetDefinitionFile ( String definitionFile, Boolean doOverride=false, Boolean runScript=true )
BooleansetRenderTimeFile ( String renderTimeFile )
Methods (render-time)
These methods affect the camera at render-time, and are provided for the render-time script only. Calling these functions from outside the render-time script will have no effect. A global transient variable named Camera - referring to the current DzShaderCamera - exists for the duration of the render-time script. Referencing this variable from outside a render-time script will result in an error.
voiddeclare ( Array tokens, Array types )
voidsetDisplay ( String name, String type, String mode, Array tokens, Array params )
voidsetHider ( String type, Array tokens, Array params )
voidsetOption ( String option, Array tokens, Array params )

Detailed Description

This class provides a DzBasicCamera derived object with creator-defined properties that will be passed to the RSL Shader at render-time. Properties intended to be used to pass values as arguments to a shader attached to the camera must be added using DzRSLShader. Properties for the camera that will be used by the render-time scripts to set attributes must be added via DzElement::addProperty().

Constructors


DzShaderCamera()

Default Constructor.


DzShaderCamera( String definitionFile, String renderTimeFile )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameter(s):

  • definitionFile - The relative [to DzApp::getScriptsPath()] path to the script file that creates this camera's property list.
  • renderTimeFile - The relative path [from DzApp::getScriptsPath()] to the DAZ Script that executes at render time.

See Also:


DzShaderCamera( String definitionFile )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameter(s):

  • definitionFile - The relative [to DzApp::getScriptsPath()] path to the script file that creates this camera's property list.

See Also:

Methods


Boolean : addShader( DzRSLShader shader )

Adds shader to this camera's internal list of shaders and sets shader 's owner to this camera.

Return Value:

  • true if shader is successfully added to the list (e.g. does not already exist), otherwise false.

String : getCameraName()

Return Value:

  • The internal name of the camera. This is not the same as the QObject::name property.

String : getDefinitionFile()

Return Value:

  • The relative path [from DzApp::getScriptsPath()] to the DAZ Script that creates this camera's property list.

Number : getNumShaders()

Return Value:

  • The number of DzRSLShaders on this camera.

String : getRenderTimeFile()

Return Value:

  • The relative path [from DzApp::getScriptsPath()] to the DAZ Script that is executed at render-time.

DzRSLShader : getShader( Number index )

Return Value:

  • The DzRSLShader at index or NULL if no shader exists at that index.

Boolean : removeShader( DzRSLShader shader )

Removes shader from this camera's internal list of shaders.

Return Value:

  • true if shader is successfully removed from the list, otherwise false.

void : setCameraName( String name )

Sets the internal name of the camera; this is not the same as the QObject::name property. By default, this is “Custom”.


void : setDefinitionFile( String definitionFile, Boolean doOverride=false, Boolean runScript=true )

Sets the relative path of the [DAZ Script] file that builds this camera's property list.

Parameter(s):

  • definitionFile - The relative path [from DzApp::getScriptsPath()] to the DAZ Script that creates this camera's property list

Attention:

  • definitionFile is executed the moment the call to this method is made. A global transient variable named Camera - referring to the current DzShaderCamera, exists for the duration of definitionFile. Referencing this variable from outside definitionFile will result in an error.

Boolean : setRenderTimeFile( String renderTimeFile )

Sets the relative path of the [DAZ Script] file that will be executed at render-time. This script can declare variables, set displays, hiders, and/or options as well as shader parameters for the element, and implement custom logic for special effects.

Parameter(s):

  • renderTimeFile - The relative path [from DzApp::getScriptsPath()] to the DAZ Script that executes at render time.

Return Value:

  • true if renderTimeFile is valid, otherwise false.

Attention:

  • When renderTimeFile is executed, a global variable named Camera - referring to the current DzShaderCamera - exists for the duration of renderTimeFile. Referencing this variable from outside filename will result in an error. See the Render Time Functions for a list of special functions only available to this script.

void : declare( Array tokens, Array types )

Sets the global graphic state by adding a series of RiDeclare calls before RiWorldBegin.

Parameter(s):

  • tokens - An Array of the String] token names to set
  • types - An Array of the corresponding String] type to set for each token

Example:

var aTokens = [ "Nn", "Pp", "Cc", "Ff" ];
var aParams = [ "varying normal", "varying point", "varying color", "varying float" ];
Camera.declare( aTokens, aParams );

void : setDisplay( String name, String type, String mode, Array tokens, Array params )

Sets the global graphic state by adding a RiDisplayV call before RiWorldBegin.

Parameter(s):

  • name - The name of the file or framebuffer to set, depending on type
  • type - The type of display to set; i.e. file, tiff, etc
  • mode - The mode to set; i.e. rgb, rgba, etc
  • tokens - An Array of the String] tokens to set
  • params - An Array of the corresponding basic type to set for each token

Example:

NEED EXAMPLE

void : setHider( String type, Array tokens, Array params )

Sets the global graphic state by adding a RiHiderV call before RiWorldBegin.

Parameter(s):

  • type - The type of hider to set; i.e. hidden, raytrace, photonmap, etc
  • tokens - An Array of the String] tokens to set
  • params - An Array of the corresponding basic type to set for each token

Example:

NEED EXAMPLE

void : setOption( String option, Array tokens, Array params )

Sets the global graphic state by adding a RiOptionV call before RiWorldBegin.

Parameter(s):

  • option - The name of the option to set
  • tokens - An Array of the String] tokens to set
  • params - An Array of the corresponding basic type to set for each token

Example:

NEED EXAMPLE