DzShaderCamera Class Reference
[Custom RSL Objects]

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

Inheritance diagram for DzShaderCamera:

DzBasicCamera DzCamera DzNode DzElement DzBase QObject Object List of all members.

Methods

Boolean addShader (DzRSLShader shader)
String getCameraName ()
String getDefinitionFile ()
Number getNumShaders ()
String getRenderTimeFile ()
DzRSLShader getShader (Number index)
Boolean removeShader (DzRSLShader shader)
void setCameraName (String name)
void setDefinitionFile (String definitionFile)
Boolean setRenderTimeFile (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 - refering 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.

void declare (Array tokens, Array types)
void setDisplay (String name, String type, String mode, Array tokens, Array params)
void setHider (String type, Array tokens, Array params)
void setOption (String option, Array tokens, Array params)

Constructors

 DzShaderCamera (String definitionFile, String renderTimeFile)
 DzShaderCamera (String definitionFile)
 DzShaderCamera ()

Detailed Description

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

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().


Constructor & Destructor Documentation

DzShaderCamera::DzShaderCamera (  ) 

Default Constructor.

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

Parameters:
definitionFile The relative [to the scripts folder] path to the script file that creates this camera's property list.
See also:
setDefinitionFile()

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

Parameters:
definitionFile The relative [to the scripts folder] path to the script file that creates this camera's property list.
renderTimeFile The relative path [from the /scripts folder] to the DAZ Script that executes at render time.
See also:
setDefinitionFile()


Member Function Documentation

Boolean DzShaderCamera::addShader ( DzRSLShader  shader  ) 

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

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

void DzShaderCamera::declare ( Array  tokens,
Array  types 
)

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

Parameters:
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 );

String DzShaderCamera::getCameraName (  ) 

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

String DzShaderCamera::getDefinitionFile (  ) 

Returns:
The relative path [from the /scripts folder] to the DAZ Script that creates this camera's property list.

Number DzShaderCamera::getNumShaders (  ) 

Returns:
The number of DzRSLShaders on this camera

String DzShaderCamera::getRenderTimeFile (  ) 

Returns:
The relative path [from ./scripts/] to the DAZ Script that is executed at render-time.

DzRSLShader DzShaderCamera::getShader ( Number  index  ) 

Returns:
The DzRSLShader at index.

Boolean DzShaderCamera::removeShader ( DzRSLShader  shader  ) 

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

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

void DzShaderCamera::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 DzShaderCamera::setDefinitionFile ( String  definitionFile  ) 

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

Parameters:
definitionFile The relative path [from the /scripts folder] 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 - refering to the current DzShaderCamera, exists for the duration of definitionFile. Referencing this variable from outside definitionFile will result in an error.

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

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

Parameters:
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 DzShaderCamera::setHider ( String  type,
Array  tokens,
Array  params 
)

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

Parameters:
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 DzShaderCamera::setOption ( String  option,
Array  tokens,
Array  params 
)

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

Parameters:
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

Boolean DzShaderCamera::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.

Parameters:
renderTimeFile The relative path [from the /scripts folder] to the DAZ Script that executes at render time.
Returns:
true if renderTimeFile is valid, otherwise false.
Attention:
When renderTimeFile is executed, a global variable named Camera - refering 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 Funtions for a list of special functions only available to this script.


Generated on Thu Sep 24 12:21:15 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.