User Tools

Site Tools


DzRSLShader

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

More...

Inherits :

Enumerations

Constructors

DAZ Script
DzRSLShader ()

Methods

DAZ Script
BooleanaddMappableProperty ( DzNumericProperty prop, String token, String mapToken )
BooleanaddMapProperty ( DzNumericProperty prop, String mapToken )
BooleanaddShaderProperty ( DzProperty prop, String token )
StringfindMapTokenByProperty ( DzNumericProperty prop )
DzPropertyfindProperty ( String name )
DzPropertyfindPropertyByToken ( String token )
StringfindTokenByProperty ( DzProperty prop )
StringgetDefinitionFile ()
NumbergetNumProperties ()
DzElementgetOwner ()
DzPropertygetProperty ( Number which )
ArraygetPropertyList ()
StringgetRenderTimeFile ()
StringgetShaderFile ()
ShaderTypegetShaderType ()
BooleanisActiveInBakePass ()
BooleanisActiveInBeautyPass ()
BooleanisActiveInShadowPass ()
BooleanisOnlyInShadowPass ()
BooleanremoveProperty ( DzProperty prop )
BooleanremoveProperty ( String name )
voidsetActiveInBakePass ( Boolean yesNo )
voidsetActiveInBeautyPass ( Boolean yesNo )
voidsetActiveInShadowPass ( Boolean yesNo )
BooleansetDefinitionFile ( String definitionFile, Boolean doOverride=false, Boolean runScript=true )
voidsetOnlyInShadowPass ( Boolean yesNo )
BooleansetRenderTimeFile ( String renderTimeFile )
BooleansetShaderFile ( String shaderFile )
BooleansetShaderType ( ShaderType shaderType )
Render-Time
These methods affect the shader object at render-time and are provided for the render-time script only. Calling these functions outside the render-time script will have no effect. A global variable named Shader, referring to the current DzRSLShader instance, exists for the duration of the render-time script. Referencing this variable outside a render-time script will result in an error.
DzVec3gammaCorrectColor ( Color color )
voidsetFloatAttrib ( String attrib, String token, Number val )
voidsetIntegerAttrib ( String attrib, String token, Number val )
voidsetColorAttrib ( String attrib, String token, Number r, Number g, Number b, Boolean isFloat=false )
voidsetStringAttrib ( String attrib, String token, String val )
voidsetPointAttrib ( String attrib, String token, DzVec3 vec )
voidsetVectorAttrib ( String attrib, String token, DzVec3 vec )
voidsetNormalAttrib ( String attrib, String token, DzVec3 vec )
voidsetMatrixAttrib ( String attrib, String token, DzMatrix4 mtx )
voidsetFloatToken ( String token, Number val )
voidsetIntegerToken ( String token, Number val )
voidsetColorToken ( String token, Color val )
voidsetStringToken ( String token, String val )
voidsetPointToken ( String token, DzVec3 vec )
voidsetVectorToken ( String token, DzVec3 vec )
voidsetNormalToken ( String token, DzVec3 vec )
voidsetMatrixToken ( String token, DzMatrix4 mtx )
voidmakeCubeFaceEnvironment ( 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 )
voidmakeLatLongEnvironment ( String pic, String tex, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params )
voidmakeShadow ( String pic, String tex, Array tokens, Array params )
voidmakeTexture ( String pic, String tex, String swrap, String twrap, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params )
voidmakeBump ( String pic, String tex, String swrap, String twrap, DzRenderOptions::PixelFilter filter, Number swidth, Number twidth, Array tokens, Array params )
voidaddTransformBegin ()
voidaddTransformEnd ()
voidaddScheduledTransformEnd ()
voidaddConcatTransform ( DzMatrix4 transform )
voidaddCoordinateSystem ( String space )
voidaddCoordSysTransform ( String space )
voidaddIdentity ()
voidaddRotate ( Number angle, Number dx, Number dy, Number dz )
voidaddScale ( Number dx, Number dy, Number dz )
voidaddScopedCoordinateSystem ( String space )
voidaddSkew ( Number angle, Number dx1, Number dy1, Number dz1, Number dx2, Number dy2, Number dz2 )
voidaddTransform ( DzMatrix4 transform )
voidaddTranslate ( Number dx, Number dy, Number dz )

Signals

Detailed Description

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:

  • One key benifit is the ability to use a single Displacement shader in both the shadow pass as well as the beauty pass. Not only does this alleviate the duplication of code, but by utilizing a Displacement shader for any bump/diplacement operations, rendering times become much faster than performing the same operations in a Surface shader. This is due to the frequency that the shader code is executed. Displacement shaders are evaluated once, at the begining of a pass, and a caching mechanism for the displaced geometry is used as the render progresses. When the same code is placed in a Surface shader, the bump/displacment calculations are performed at every evaluation of the surface.
  • Another key benifit is the ability to use a highly optimized Surface shader during the shadow [map] pass, which can have a significant impact on the time required to generate a shadow map - and thus complete the render.

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:

Enumerations


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

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

Constructors


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.

Methods


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

Parameter(s):

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

Return Value:

  • true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

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

Parameter(s):

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

Return Value:

  • true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

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

Parameter(s):

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

Return Value:

  • true if prop was successfully added to the list of properties used by this shader (e.g. did not already exist), otherwise false.

String : findMapTokenByProperty( DzNumericProperty prop )

Return Value:

  • 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 : findProperty( String name )

Return Value:

  • The property named name if name is found, otherwise NULL.

DzProperty : findPropertyByToken( String token )

Return Value:

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

String : findTokenByProperty( DzProperty prop )

Return Value:

  • 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 : getDefinitionFile()

Return Value:

  • The path to the definition script for this shader object.

Number : getNumProperties()

Return Value:

  • The number of properties currently used by this shader object.

DzElement : getOwner()

Return Value:


DzProperty : getProperty( Number which )

Get a property from this shader's property list.

Parameter(s):

  • which - Index of the property to return.

Return Value:

  • If which is within range, the property at the given index, otherwise NULL.

Since:

  • 4.9.0.46

Array : getPropertyList()

Return Value:

  • A list of all the properties on this shader.

Since:

  • 4.9.0.46

String : getRenderTimeFile()

Return Value:

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

String : getShaderFile()

Return Value:

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

ShaderType : getShaderType()

Return Value:

  • The RSL shader type for this object.

Boolean : isActiveInBakePass()

Return Value:

  • true if this shader participates in the bake pass, otherwise false.

Boolean : isActiveInBeautyPass()

Return Value:

  • true if this shader participates in the beauty pass, otherwise false.

Boolean : isActiveInShadowPass()

Return Value:

  • true if this shader participates in the shadow pass, otherwise false.

Boolean : isOnlyInShadowPass()

Return Value:

  • true if this shader ONLY participates in the shadow pass, otherwise false. Same as isActiveInShadowPass() && !isActiveInBeautyPass().

Boolean : removeProperty( DzProperty prop )

Removes the given property, if it can be found.

Parameter(s):

  • prop - The property to remove from the shader.

Return Value:

  • true on success, otherwise false.

Boolean : removeProperty( String name )

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

Parameter(s):

  • name - The name of the property to remove from the shader.

Return Value:

  • true on success, otherwise false.

void : 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 : setActiveInBeautyPass( Boolean yesNo )

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

See Also:


void : setActiveInShadowPass( Boolean yesNo )

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

See Also:


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

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

Parameter(s):

  • definitionFile - The relative path (from DzApp::getScriptsPath()) to the DAZ Script that creates this shader object's property list.
  • doOverride - Whether or not to override the setting of the definition file if it has already been set.
  • runScript - Whether or not to run the definition script upon setting it.

Return Value:

  • true if definitionFile is valid, otherwise false.

Attention:

  • definitionFile is executed the moment the call to this method is made. A global variable named Shader - referring 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:


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


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

Parameter(s):

  • renderTimeFile - The relative path (from DzApp::getScriptsPath()) to the DAZ Script that sets any attributes or shader parameters at render time.

Return Value:

  • true if renderTimeFile is valid, otherwise false.

Attention:

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

See Also:


Boolean : setShaderFile( String shaderFile )

Sets the shader file that this shader object calls when rendered.

Parameter(s):

  • shaderFile - The relative path, from DzApp::getShadersPath(), 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”.

Return Value:

  • true if shaderFile plus the shader extension for the active renderer exists, 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:


Boolean : setShaderType( ShaderType shaderType )

Sets the type for this shader object.

Parameter(s):

  • shaderType - The type of shader to set.

Example:

var oShadObj = new DzRSLShader;
oShadObj.setShaderType( DzRSLShader.Surface );

DzVec3 : gammaCorrectColor( Color color )

Parameter(s):

  • color - The color to gamma correct.

Return Value:

  • The color as a DzVec3 gamma corrected if gamma correction is on and in the range of 0-1 for r, g, b. Alpha is ignored.

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

Adds a RiAttribute call with a float value.

Parameter(s):

  • 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 : setIntegerAttrib( String attrib, String token, Number val )

Adds a RiAttribute call with an integer value.

Parameter(s):

  • 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 : setColorAttrib( String attrib, String token, Number r, Number g, Number b, Boolean isFloat=false )

Adds a RiAttribute call with a color value.

Parameter(s):

  • 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 : setStringAttrib( String attrib, String token, String val )

Adds a RiAttribute call with a string value.

Parameter(s):

  • 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 : setPointAttrib( String attrib, String token, DzVec3 vec )

Adds a RiAttribute call with a point value.

Parameter(s):

  • 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 : setVectorAttrib( String attrib, String token, DzVec3 vec )

Adds a RiAttribute call with a vector value.

Parameter(s):

  • 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 : setNormalAttrib( String attrib, String token, DzVec3 vec )

Adds a RiAttribute call with a normal value.

Parameter(s):

  • 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 : setMatrixAttrib( String attrib, String token, DzMatrix4 mtx )

Adds a RiAttribute call with a matrix value.

Parameter(s):

  • 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 : setFloatToken( String token, Number val )

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

Parameter(s):

  • token - The name of the token to set.
  • val - The float value to set.

void : setIntegerToken( String token, Number val )

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

Parameter(s):

  • token - The name of the token to set.
  • val - The integer value to set.

void : setColorToken( String token, Color val )

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

Parameter(s):

  • token - The name of the token to set.
  • val - The color value to set.

void : setStringToken( String token, String val )

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

Parameter(s):

  • token - The name of the token to set.
  • val - The string value to set.

void : setPointToken( String token, DzVec3 vec )

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

Parameter(s):

  • token - The name of the token to set.
  • vec - The point value (x, y, z) to set.

void : setVectorToken( String token, DzVec3 vec )

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

Parameter(s):

  • token - The name of the token to set.
  • vec - The vector value (x, y, z) to set.

void : setNormalToken( String token, DzVec3 vec )

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

Parameter(s):

  • token - The name of the token to set.
  • vec - The normal value (x, y, z) to set.

void : setMatrixToken( String token, DzMatrix4 mtx )

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

Parameter(s):

  • token - The name of the token to set.
  • mtx - The matrix value to set.

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 )

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

Parameter(s):

  • 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 - A list of additional String] tokens to set.
  • params - A list 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 : 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.

Parameter(s):

  • 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 - A list of additional String] tokens to set.
  • params - A list 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 : makeShadow( String pic, String tex, Array tokens, Array params )

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

Parameter(s):

  • pic - The path of the source image.
  • tex - The path of the resultant image.
  • tokens - A list of additional String] tokens to set.
  • params - A list of the corresponding basic type to set for each token.

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

Parameter(s):

  • 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 - A list of additional String] tokens to set.
  • params - A list 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 : 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.

Parameter(s):

  • 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 - A list of additional String] tokens to set.
  • params - A list 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 : addTransformBegin()

Adds a RiSpec RiTransformBegin() call.

Attention:

Since:

  • 4.10.0.108

void : addTransformEnd()

Adds a RiSpec RiTransformEnd() call.

Attention:

  • Each call to this method must be matched with an earlier call to addTransformBegin().

Since:

  • 4.10.0.108

void : addScheduledTransformEnd()

Adds a RiSpec RiTransformEnd() call after the owner.

Attention:

  • Each call to this method must be matched with an earlier call to addTransformBegin().
var oOwner = Shader.getOwner();
if( oOwner.inherits("DzShaderLight") && !oOwner.usesLocalShaderSpace() ){
	Shader.addTransformBegin();
	Shader.addIdentity();
 
	var mtxTransform = new DzMatrix4( 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1 );
	Shader.addTransform( mtxTransform );
 
	var vecPos = !oOwner.isDirectional() ? oOwner.getWSPos() : new DzVec3( 0, 0, -200 );
	var quatRot = oOwner.getWSRot();
	var vecAxis = quatRot.getAxisOfRotation();
	var nRadiansToDegrees = 180 / Math.PI;
	var nAngle = quatRot.getAngleOfRotation() * nRadiansToDegrees;
 
	Shader.addTranslate( vecPos.x, vecPos.y, vecPos.z );
	Shader.addRotate( -nAngle, vecAxis.x, vecAxis.y, vecAxis.z );
	Shader.addCoordinateSystem( "3DLEnvSpace" );
	Shader.addScheduledTransformEnd();
}

Since:

  • 4.10.0.108

void : addConcatTransform( DzMatrix4 transform )

Adds a RiSpec RiConcatTransform() call.

Parameter(s):

  • transform - The transform to concatenate.

Since:

  • 4.10.0.108

void : addCoordinateSystem( String space )

Adds a RiSpec RiCoordinateSystem() call.

Parameter(s):

  • space - The name for the coordinate system.

Since:

  • 4.10.0.108

void : addCoordSysTransform( String space )

Adds a RiSpec RiCoordSysTransform() call.

Parameter(s):

  • space - The name for the coordinate system.

Since:

  • 4.10.0.108

void : addIdentity()

Adds a RiSpec RiIdentity() call.

Since:

  • 4.10.0.108

void : addRotate( Number angle, Number dx, Number dy, Number dz )

Adds a RiSpec RiRotate() call.

Parameter(s):

  • angle -
  • dx -
  • dy -
  • dz -

Since:

  • 4.10.0.108

void : addScale( Number dx, Number dy, Number dz )

Adds a RiSpec RiScale() call.

Parameter(s):

  • dx -
  • dy -
  • dz -

Since:

  • 4.10.0.108

void : addScopedCoordinateSystem( String space )

Adds a RiSpec DDiScopedCoordinateSystem() call.

Parameter(s):

  • space - The name for the coordinate system.

Since:

  • 4.10.0.108

void : addSkew( Number angle, Number dx1, Number dy1, Number dz1, Number dx2, Number dy2, Number dz2 )

Adds a RiSpec RiSkew() call.

Parameter(s):

  • angle -
  • dx1 -
  • dy1 -
  • dz1 -
  • dx2 -
  • dy2 -
  • dz2 -

Since:

  • 4.10.0.108

void : addTransform( DzMatrix4 transform )

Adds a RiSpec RiTransform() call.

Parameter(s):

  • transform - The transform to set.

Since:

  • 4.10.0.108

void : addTranslate( Number dx, Number dy, Number dz )

Adds a RiSpec RiTranslate() call.

Parameter(s):

  • dx -
  • dy -
  • dz -

Since:

  • 4.10.0.108

Signals


void : propertyAdded( DzProperty prop )

Signature:“propertyAdded(DzProperty*)”

Transmitted when a property is added to this element.

Parameter(s):

  • prop - The property added.

void : propertyListChanged()

Signature:“propertyListChanged()”

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


void : propertyRemoved( DzProperty prop )

Signature:“propertyRemoved(DzProperty*)”

Transmitted when a property is removed from this element.

Parameter(s):

  • prop - The property removed.