User Tools

Site Tools


DzShaderLight

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

More...

Inherits :

Enumerations

Constructors

DAZ Script
DzShaderLight ()
DzShaderLight ( String definitionFile, LightType type )

Methods

Detailed Description

This class provides a DzLight derived object with creator-defined properties that will be passed to the RSL Shader at render-time. By default, the light only has two properties - Color and Intensity. The values of these properties are not sent to the shader by default, nor are any attributes set representing the value of these properties. Unless put to use via DzRSLShader, these properties are purely for OpenGL purposes. These properties are not mappable by default, but can be made so by using DzRSLShader::addMapProperty() or DzRSLShader::addMappableProperty(). All other properties for the light must be added using DzRSLShader in order to be used to pass values as arguments to the shader. Properties for the light that will be used by the render-time scripts to set attributes must be added via DzElement::addProperty().

Enumerations


: LightType

Enumerated values for the light type

See Also:

  • NullLight - Null - Only in the scene to provide access to properties.
  • AmbientLight - Emits global light.
  • PointLight - Emits light in all directions.
  • DistantLight - Emits parallel light.
  • SpotLight - Emits light in a pattern.

Constructors


DzShaderLight()

Default Constructor.


DzShaderLight( String definitionFile, LightType type )

Parameter(s):

  • definitionFile - The relative [from DzApp::getScriptsPath()] path to the script file that creates this light's property list.
  • lightType - The enumerated type for the light. This controls certain aspects of the light, for instance whether or not the user can view through the light, the icon displayed in the Scene pane, the avatar representing the light in the viewport.

See Also:

Methods


Boolean : addShader( DzRSLShader shader )

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

Return Value:

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

DzColorProperty : getColorControl()

Return Value:

  • The property that controls the color of this light.

String : getDefinitionFile()

Return Value:

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

Number : getIntensity()

Return Value:

  • The value of the property that controls the intensity of this light.

DzFloatProperty : getIntensityControl()

Return Value:

  • The property that controls the intensity of this light.

String : getLightName()

Return Value:

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

LightType : getLightType()

Return Value:

  • The type of the light.

Number : getNumShaders()

Return Value:

  • The number of DzRSLShaders on this light.

DzRSLShader : getShader( Number index )

Return Value:

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

String : getShadowMapPath()

Return Value:

  • The path to the generated shadow map for this light.

Boolean : removeShader( DzRSLShader shader )

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

Return Value:

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

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

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

Parameter(s):

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

Attention:

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

void : setLightName( String name )

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


void : setLightType( LightType type )

Sets the type of a light. A light's type determines the OpenGL representation.


void : setUseLocalShaderSpace( Boolean onOff )

Sets a flag so that transforms are applied to the coordinate space that the light is in, greatly simplifying shader math.


Boolean : usesLocalShaderSpace()

Return Value:

  • Whether transforms are applied to the coordinate space that the light is in. false by default