DzRSLShader Class Reference
[Custom RSL Objects]

Custom scriptable class for RenderMan® Shader Language (RSL) Shader types. More...

Inheritance diagram for DzRSLShader:

DzBase QObject Object List of all members.

Enumerations

enum  ShaderType {
  None, Surface, Light, LightArea,
  VolumeAtmosphere, VolumeInterior, VolumeExterior, Displacement,
  Imager
}

Signals

void Added (DzProperty prop)
 Signature: "propertyAdded(DzProperty*)"
void ListChanged ()
 Signature: "propertyListChanged()"
void Removed (DzProperty prop)
 Signature: "propertyRemoved(DzProperty*)"

Methods

Boolean addMappableProperty (DzNumericProperty prop, String token, String mapToken)
Boolean addMapProperty (DzNumericProperty prop, String mapToken)
Boolean addShaderProperty (DzProperty prop, String token)
String findMapTokenByProperty (DzNumericProperty prop)
DzProperty findProperty (String name)
DzProperty findPropertyByToken (String token)
String findTokenByProperty (DzProperty prop)
String getDefinitionFile ()
Number getNumProperties ()
DzElement getOwner ()
String getRenderTimeFile ()
String getShaderFile ()
ShaderType getShaderType ()
Boolean isActiveInBakePass ()
Boolean isActiveInBeautyPass ()
Boolean isActiveInShadowPass ()
Boolean isOnlyInShadowPass ()
Boolean removeProperty (String name)
Boolean removeProperty (DzProperty prop)
void setActiveInBakePass (Boolean yesNo)
void setActiveInBeautyPass (Boolean yesNo)
void setActiveInShadowPass (Boolean yesNo)
Boolean setDefinitionFile (String definitionFile)
void setOnlyInShadowPass (Boolean yesNo)
Boolean setRenderTimeFile (String renderTimeFile)
Boolean setShaderFile (String shaderFile)
Boolean setShaderType (ShaderType shaderType)

Constructors

 DzRSLShader ()

Methods (render-time)

These methods affect the shader object 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 Shader - refering to the current DzRSLShader - exists for the duration of the render-time script. Referencing this variable from outside a render-time script will result in an error.

void makeBump (String pic, String tex, String swrap, String twrap, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params)
void makeCubeFaceEnvironment (String px, String nx, String py, String ny, String pz, String nz, String tex, Number fov, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params)
void makeLatLongEnvironment (String pic, String tex, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params)
void makeShadow (String pic, String tex, Array tokens, Array params)
void makeTexture (String pic, String tex, String swrap, String twrap, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params)
void setColorAttrib (String attrib, String token, Number r, Number g, Number b, Boolean isFloat=false)
void setColorToken (String token, Color val)
void setFloatAttrib (String attrib, String token, Number val)
void setFloatToken (String token, Number val)
void setIntegerAttrib (String attrib, String token, Number val)
void setIntegerToken (String token, Number val)
void setMatrixAttrib (String attrib, String token, DzMatrix4 mtx)
void setMatrixToken (String token, DzMatrix4 mtx)
void setNormalAttrib (String attrib, String token, DzVec3 vec)
void setNormalToken (String token, DzVec3 vec)
void setPointAttrib (String attrib, String token, DzVec3 vec)
void setPointToken (String token, DzVec3 vec)
void setStringAttrib (String attrib, String token, String val)
void setStringToken (String token, String val)
void setVectorAttrib (String attrib, String token, DzVec3 vec)
void setVectorToken (String token, DzVec3 vec)

Detailed Description

Custom scriptable class for RenderMan® Shader Language (RSL) Shader types.

This class provides the ability to define RSL shaders for the elements that can use them (DzShaderMaterial, DzShaderLight, DzShaderCamera).

Optimizations:
Two methods in this class that should not be overlooked are setActiveInShadowPass() and setOnlyInShadowPass(), as they can have a significant impact on render times.

In the context of Surface shaders, the data members set by these methods are used to identify whether the shader participates during the shadow [map] pass - the pass for each contributing light in the scene that indicates the use of Deep Shadow Maps for shadows. This affords developers a couple of key benifits:

In the context of Light shaders, the data members set by these methods are used to identify whether this shader participates when the DzLight::ShadowType indicates shadowing is used. This affords developers the benifit of being able to use Light shaders that are optimized for either condition.

Property Naming:
Standard Shader and Materials Presets make an effort to copy as much as possible from one element to the next via DzElement::copyFrom(). In order for this to occur, the properties must match in both name and type. Provided below are the names and types used by DzDefaultMaterial, DzLight, DzDistantLight, DzSpotLight and DzPointLight in the event that you would like use properties that will work with the copyFrom() method.

Default Material: Default Lights: Default Camera:
Name Type   Name Type
Diffuse Color DzColorProperty Negative Bump DzFloatProperty
Diffuse Strength DzFloatProperty Positive Bump DzFloatProperty
Glossiness DzFloatProperty Displacement Strength DzFloatProperty
Specular Color DzColorProperty Minimum Displacement DzFloatProperty
Specular Strength DzFloatProperty Maximum Displacement DzFloatProperty
Multiply Specular
Through Opacity
DzBoolProperty Reflection Color DzColorProperty
Ambient Color DzColorProperty Reflection Strength DzFloatProperty
Ambient Strength DzFloatProperty Refraction Color DzColorProperty
Opacity Strength DzFloatProperty Refraction Strength DzFloatProperty
Bump Strength DzFloatProperty Index of Refraction DzFloatProperty
Name Type
Color DzColorProperty
Intensity DzFloatProperty
Shadow Type DzEnumProperty
Shadow Bias DzFloatProperty
Shadow Softness DzFloatProperty
Illumination DzEnumProperty
 
Spread Angle DzFloatProperty
Name Type
Focal Length DzFloatProperty
DOF DzBoolProperty
Depth of Field DzFloatProperty
Aperature DzFloatProperty

Samples:
See also:
Recommended Reading:


Member Enumeration Documentation

enum DzRSLShader::ShaderType

Enumerated values for RSL shader types

Attention:
The enumerated values provided are a mechanism designed to allow the appropriate RI call to be made. These values do not guarantee support by the active renderer. It is strongly recomended that you become familiar with the target renderer and its capabilities; i.e. 3Delight does not support Exterior volumes, and some renderers may not support Area Light sources or Imagers.
See also:
setShaderType
Enumerator:
None  Null
Surface  Uses the RiSurfaceV API call when passed to the renderer.
Light  Uses the RiLightSourceV API call when passed to the renderer.
LightArea  Uses the RiAreaLightSourceV API call when passed to the renderer.
VolumeAtmosphere  Uses the RiAtmosphereV API call when passed to the renderer.
VolumeInterior  Uses the RiInteriorV API call when passed to the renderer.
VolumeExterior  Uses the RiExteriorV API call when passed to the renderer.
Displacement  Uses the RiDisplacementV API call when passed to the renderer.
Imager  Uses the RiImagerV API call when passed to the renderer.


Constructor & Destructor Documentation

DzRSLShader::DzRSLShader (  ) 

Default Constructor.

Attention:
Caution should be taken when instantiating this class. Until addShader(...) is called by DzShaderMaterial, DzShaderLight or DzShaderCamera, the object has no owner - which if you are not careful can lead to a memory leak. It is strongly suggested that the statement in the script immediately following that which instantiates this class add the object to the intended owner.


Member Function Documentation

void DzRSLShader::Added ( DzProperty  prop  ) 

Signature: "propertyAdded(DzProperty*)"

Transmitted when a property is added to this element

Parameters:
prop A pointer the the property just added

Boolean DzRSLShader::addMappableProperty ( DzNumericProperty  prop,
String  token,
String  mapToken 
)

Adds a mappable numeric property to this shader object. DzColorProperty instances are passed as color type variables to the shader - all other DzNumericProperty derived instances are passed as float type variables. If the property is mapped, the absolute path of the image file is passed as a string type variable to the shader.

Parameters:
prop The property of which the value is passed to the shader for the param argument
token The name of the argument to the shader that the value of prop is passed to
mapToken The name of the argument to the shader that the path of prop 's map is passed to, if prop is mapped
Returns:
true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

Boolean DzRSLShader::addMapProperty ( DzNumericProperty  prop,
String  mapToken 
)

Adds a mappable numeric property to this shader object (intended for situations where the property itself is passed as an attribute via the render-time script, or simply for display purposes, but the associated map should be passed as an arg to the shader). If the property is mapped, the absolute path of the image file is passed as a string type variable to the shader.

Parameters:
prop The property of which the map path is passed to the shader for the mapParam argument
mapToken The name of the argument to the shader that the path of prop 's map is passed to, if prop is mapped
Returns:
true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

Boolean DzRSLShader::addShaderProperty ( DzProperty  prop,
String  token 
)

Adds a standard property to the list of properties used by this shader object, and adds the property to this shader object's owner if it does not already exist. DzColorProperty instances are passed as color type variables to the shader - all other DzNumericProperty derived instances are passed as float type variables. DzImageProperty instances are passed as string type variables (the value of which is the absolute path of the image file).

Parameters:
prop The property of which the value is passed to the shader for the param argument
token The name of the argument to the shader that the value of prop is passed to
Returns:
true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

String DzRSLShader::findMapTokenByProperty ( DzNumericProperty  prop  ) 

Returns:
The name of the argument to the shader that the map value of prop is passed to, if prop is mappable. Returns an empty string if prop is not found, or not mappable.

DzProperty DzRSLShader::findProperty ( String  name  ) 

Returns:
The property named name, if name is found. Undefined by default.

DzProperty DzRSLShader::findPropertyByToken ( String  token  ) 

Returns:
The property that passes a value to the shader via token, if token is found. Undefined by default.

String DzRSLShader::findTokenByProperty ( DzProperty  prop  ) 

Returns:
The name of the argument to the shader that the value of prop is passed to. Returns an empty string if prop is not found.

String DzRSLShader::getDefinitionFile (  ) 

Returns:
The path to the definition script for this shader object.

Number DzRSLShader::getNumProperties (  ) 

Returns:
The number of properties currently used by this shader object.

DzElement DzRSLShader::getOwner (  ) 

Returns:
The owner (DzShaderMaterial, DzShaderLight, DzShaderCamera) of this object.

String DzRSLShader::getRenderTimeFile (  ) 

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

String DzRSLShader::getShaderFile (  ) 

Returns:
The path to the RSL shader (sans-extension) for this shader object.

ShaderType DzRSLShader::getShaderType (  ) 

Returns:
The RSL shader type for this object.

Boolean DzRSLShader::isActiveInBakePass (  ) 

Returns:
Whether this shader participates in the bake pass. False by default.

Boolean DzRSLShader::isActiveInBeautyPass (  ) 

Returns:
Whether this shader participates in the beauty pass. True by default.

Boolean DzRSLShader::isActiveInShadowPass (  ) 

Returns:
Whether this shader participates in the shadow pass. False by default.

Boolean DzRSLShader::isOnlyInShadowPass (  ) 

Returns:
Whether this shader ONLY participates in the shadow pass. Same as isActiveInShadowPass() && !isActiveInBeautyPass()

void DzRSLShader::ListChanged (  ) 

Signature: "propertyListChanged()"

Transmitted when a property is added to or removed from this element

void DzRSLShader::makeBump ( String  pic,
String  tex,
String  swrap,
String  twrap,
DzRenderOptions::PixelFilter  filter,
Number  swidth,
Number  twidth,
Array  tokens,
Array  params 
)

Convert a bump map into a map in the format required by the renderer.

Parameters:
pic The path of the source image
tex The path of the resultant image
swrap The wrapping behavior of s coordinate;
twrap The wrapping behavior of t coordinate
filter The pre-defined filter to use
swidth The filter width multiplier for the s direction
twidth The filter width multiplier for the t direction
tokens An Array of additional [String] tokens to set
params An Array of the corresponding basic type to set for each token
Attention:
In most cases, in DAZ Script 2, enumerated values are accessed like properties on the global object constructor (i.e. DzRenderOptions.Gaussian), but in this particular case the enumerations on DzRenderOptions for the filter argument are accessed like properties on an instance of the global object.
        var oRenderMgr = App.getRenderMgr();
        var oOptions = oRenderMgr.getRenderOptions();
        ...
        oOptions.Gaussian;
        ...

void DzRSLShader::makeCubeFaceEnvironment ( String  px,
String  nx,
String  py,
String  ny,
String  pz,
String  nz,
String  tex,
Number  fov,
DzRenderOptions::PixelFilter  filter,
Number  swidth,
Number  twidth,
Array  tokens,
Array  params 
)

Convert six images representing six viewing directions into an environment map in the format required by the renderer.

Parameters:
px The path of the image as viewed from the positive x direction
nx The path of the image as viewed from the negative x direction
py The path of the image as viewed from the positive y direction
ny The path of the image as viewed from the negative y direction
pz The path of the image as viewed from the positive z direction
nz The path of the image as viewed from the negative x direction
tex The path of the resultant image
fov The full horizontal field of view used to generate the input images
filter The pre-defined filter to use
swidth The filter width multiplier for the s direction
twidth The filter width multiplier for the t direction
tokens An Array of additional [String] tokens to set
params An Array of the corresponding basic type to set for each token
Attention:
In most cases, in DAZ Script 2, enumerated values are accessed like properties on the global object constructor (i.e. DzRenderOptions.Gaussian), but in this particular case the enumerations on DzRenderOptions for the filter argument are accessed like properties on an instance of the global object.
        var oRenderMgr = App.getRenderMgr();
        var oOptions = oRenderMgr.getRenderOptions();
        ...
        oOptions.Gaussian;
        ...

void DzRSLShader::makeLatLongEnvironment ( String  pic,
String  tex,
DzRenderOptions::PixelFilter  filter,
Number  swidth,
Number  twidth,
Array  tokens,
Array  params 
)

Convert an image representing a latitude-longitude map into an environment map in the format required by the renderer.

Parameters:
pic The path of the source image
tex The path of the resultant image
filter The pre-defined filter to use
swidth The filter width multiplier for the s direction
twidth The filter width multiplier for the t direction
tokens An Array of additional [String] tokens to set
params An Array of the corresponding basic type to set for each token
Attention:
In most cases, in DAZ Script 2, enumerated values are accessed like properties on the global object constructor (i.e. DzRenderOptions.Gaussian), but in this particular case the enumerations on DzRenderOptions for the filter argument are accessed like properties on an instance of the global object.
        var oRenderMgr = App.getRenderMgr();
        var oOptions = oRenderMgr.getRenderOptions();
        ...
        oOptions.Gaussian;
        ...

void DzRSLShader::makeShadow ( String  pic,
String  tex,
Array  tokens,
Array  params 
)

Convert a depth image into a shadow map in the format required by the renderer.

Parameters:
pic The path of the source image
tex The path of the resultant image
tokens An Array of additional [String] tokens to set
params An Array of the corresponding basic type to set for each token

void DzRSLShader::makeTexture ( String  pic,
String  tex,
String  swrap,
String  twrap,
DzRenderOptions::PixelFilter  filter,
Number  swidth,
Number  twidth,
Array  tokens,
Array  params 
)

Convert an image map into a map in the format required by the renderer.

Parameters:
pic The path of the source image
tex The path of the resultant image
swrap The wrapping behavior of s coordinate;
twrap The wrapping behavior of t coordinate
filter The pre-defined filter to use
swidth The filter width multiplier for the s direction
twidth The filter width multiplier for the t direction
tokens An Array of additional [String] tokens to set
params An Array of the corresponding basic type to set for each token
Attention:
In most cases, in DAZ Script 2, enumerated values are accessed like properties on the global object constructor (i.e. DzRenderOptions.Gaussian), but in this particular case the enumerations on DzRenderOptions for the filter argument are accessed like properties on an instance of the global object.
        var oRenderMgr = App.getRenderMgr();
        var oOptions = oRenderMgr.getRenderOptions();
        ...
        oOptions.Gaussian;
        ...

void DzRSLShader::Removed ( DzProperty  prop  ) 

Signature: "propertyRemoved(DzProperty*)"

Transmitted when a property is removed from this element

Parameters:
prop A pointer the the property just removed

Boolean DzRSLShader::removeProperty ( String  name  ) 

Removes the property named name, if it can be found.

Parameters:
name The name of the property to remove from the shader.
Returns:
true on success, otherwise false.

Boolean DzRSLShader::removeProperty ( DzProperty  prop  ) 

Removes the given property, if it can be found.

Parameters:
prop The property to remove from the shader.
Returns:
true on success, otherwise false.

void DzRSLShader::setActiveInBakePass ( Boolean  yesNo  ) 

Sets whether this shader object participates in the baking pass. False by default. If this is set to true, the shader must have a string input variable named "BakeFileName" and another string input variable named "BakeType".

"BakeFileName" will not be set unless it is a baking pass. When set, it will contain the name of the file to bake into.

"BakeType" will be set to one of three values: "Illumination", "Shader", or "IllumShader". They indicate as follows:

Illumination
Bake only the illumination seen by the surface.
Shader
Bake the shader without any illuminations. (Assume all points are lit uniformly at 100%).
IllumShader
Bake the shader and illumination contributions.
Note:
Only one of the rsl shaders on a material should have this set to true.

void DzRSLShader::setActiveInBeautyPass ( Boolean  yesNo  ) 

Sets whether this shader object participates in the beauty/final pass. True by default.

See also:
setOnlyInShadowPass()

void DzRSLShader::setActiveInShadowPass ( Boolean  yesNo  ) 

Sets whether this shader object participates in the shadow pass. False by default.

See also:
setOnlyInShadowPass()

void DzRSLShader::setColorAttrib ( String  attrib,
String  token,
Number  r,
Number  g,
Number  b,
Boolean  isFloat = false 
)

Adds a RiAttribute call with a color value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
r The value for the red color component
g The value for the green color component
b The value for the blue color component
isFloat A flag for indicating whether or not the values passed to r, g and b are floating point numbers (in the 0-1 range).
Example:
        var color = new Color( 210, 210, 210 );
        Shader.setColorAttrib( "user", "color myColor", color.red, color.green, color.blue );
        ///Shader.setColorAttrib( "user", "color myColor", color.red, color.green, color.blue, false );

Attention:
If isFloat is false (the default), the values of r, g and b are assumed to be in the [0,255] range and will be converted to the [0,1] range prior to being passed on to the renderer. This allows for the values of the individual components to be driven beyond their normal range in cases where such an ability is needed, as with some subsurface scattering techniques.

void DzRSLShader::setColorToken ( String  token,
Color  val 
)

Sets the value of a color token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
val The color value to set

Boolean DzRSLShader::setDefinitionFile ( String  definitionFile  ) 

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

Parameters:
definitionFile The relative path [from the /scripts folder] to the DAZ Script that creates this shader object's property list
Returns:
true if definitionFile is valid, otherwise false.
Attention:
definitionFile is executed the moment the call to this method is made. A global transient variable named Shader - refering to the current DzRSLShader being rendered, exists for the duration of definitionFile. Referencing this variable from outside definitionFile will result in an error.
See also:
RiSpec Constant Material Definition

void DzRSLShader::setFloatAttrib ( String  attrib,
String  token,
Number  val 
)

Adds a RiAttribute call with a float value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
val The float value to set
Example:
        Shader.setFloatAttrib( "user", "float myFloat", 1.0 );

void DzRSLShader::setFloatToken ( String  token,
Number  val 
)

Sets the value of a float token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
val The float value to set

void DzRSLShader::setIntegerAttrib ( String  attrib,
String  token,
Number  val 
)

Adds a RiAttribute call with a integer value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
val The integer value to set
Example:
        Shader.setIntegerAttrib( "user", "integer myInteger", 1 );

void DzRSLShader::setIntegerToken ( String  token,
Number  val 
)

Sets the value of an integer token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
val The integer value to set

void DzRSLShader::setMatrixAttrib ( String  attrib,
String  token,
DzMatrix4  mtx 
)

Adds a RiAttribute call with a matrix value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
mtx The matrix value to set
Example:
        Shader.setMatrixAttrib( "user", "matrix myMatrix", new DzMatrix4() );

void DzRSLShader::setMatrixToken ( String  token,
DzMatrix4  mtx 
)

Sets the value of a matrix token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
mtx The matrix value to set

void DzRSLShader::setNormalAttrib ( String  attrib,
String  token,
DzVec3  vec 
)

Adds a RiAttribute call with a normal value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
vec The normal value (x, y, z) to set
Example:
        Shader.setNormalAttrib( "user", "normal myNormal", new DzVec3( 1, 1, 1 ) );

void DzRSLShader::setNormalToken ( String  token,
DzVec3  vec 
)

Sets the value of a normal token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
vec The normal value (x, y, z) to set

void DzRSLShader::setOnlyInShadowPass ( Boolean  yesNo  ) 

Sets whether this shader object ONLY participates in the shadow pass. False by default. This is the same as calling setActiveInBeautyPass( false ) and setActiveInShadowPass( true ).

See also:
setActiveInShadowPass(),setActiveInBeautyPass()

void DzRSLShader::setPointAttrib ( String  attrib,
String  token,
DzVec3  vec 
)

Adds a RiAttribute call with a point value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
vec The point value (x, y, z) to set
Example:
        Shader.setPointAttrib( "user", "point myPoint", new DzVec3( 1, 1, 1 ) );

void DzRSLShader::setPointToken ( String  token,
DzVec3  vec 
)

Sets the value of a point token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
vec The point value (x, y, z) to set

Boolean DzRSLShader::setRenderTimeFile ( String  renderTimeFile  ) 

Sets the relative path of the [DAZ Script] file that will be executed at render-time. This script can set attributes 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 sets any attributes or shader parameters at render time.
Returns:
true if renderTimeFile is valid, otherwise false.
Attention:
When filename is executed, a global variable named Shader - refering to the current DzRSLShader being rendered - exists for the duration of filename. 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.
See also:
RiSpec Constant Material Definition

Boolean DzRSLShader::setShaderFile ( String  shaderFile  ) 

Sets the shader file that this shader object calls when rendered

Parameters:
shaderFile The relative path [from ./shaders/] to the shader that this shader object calls when rendered. The filename is expected to be sans-extension (e.g. "dzplastic", not "dzplastic.sl" or "dzplastic.sdl" ).
Returns:
true if shaderFile , plus the shader extension for the active renderer, is valid, otherwise false.
Attention:
Shaders built for use with DAZ Studio do not require any arguments in the main function. Surfaces, for instance, make use of the Standard Shading Attributes "Color" and "Opacity" and are set via the "Diffuse Color" and "Opacity Strength" properties, respectively. These properties are created by the DzShaderMaterial constructor. The values of these attributes are accessible in the shader via the Predefined Surface Shader Variables "Cs" and "Os", respectively.

For Volume shaders the render option "standardatmosphere" is set to 0. See 3Delight documentations for more information on this option and its effect on volume shaders.

See also:
RiSpec Constant Material Definition, RiSpec Constant Surface Shader

Boolean DzRSLShader::setShaderType ( ShaderType  shaderType  ) 

Sets the type for this shader object.

Example:
        var g_oShadObj = new DzRSLShader;
        g_oShadObj.setShaderType( DzRSLShader.Surface );

void DzRSLShader::setStringAttrib ( String  attrib,
String  token,
String  val 
)

Adds a RiAttribute call with a string value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
val The string value to set
Example:
        Shader.setStringAttrib( "user", "string myString", "foo.bar" );

void DzRSLShader::setStringToken ( String  token,
String  val 
)

Sets the value of a string token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
val The string value to set

void DzRSLShader::setVectorAttrib ( String  attrib,
String  token,
DzVec3  vec 
)

Adds a RiAttribute call with a vector value.

Parameters:
attrib The name of the attribute to set
token The name of the token to set
vec The vector value (x, y, z) to set
Example:
        Shader.setVectorAttrib( "user", "vector myVector", new DzVec3( 1, 1, 1 ) );

void DzRSLShader::setVectorToken ( String  token,
DzVec3  vec 
)

Sets the value of a vector token in the list of tokens passed to the shader.

Parameters:
token The name of the token to set
vec The vector value (x, y, z) to set


Generated on Thu Sep 24 12:21:15 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.