DzShaderLight Class Reference
[Custom RSL Objects]

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

Inheritance diagram for DzShaderLight:

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

Enumerations

enum  LightType {
  NullLight = 0, AmbientLight, PointLight, DistantLight,
  SpotLight
}

Methods

Boolean addShader (DzRSLShader shader)
DzColorProperty getColorControl ()
String getDefinitionFile ()
Number getIntensity ()
DzFloatProperty getIntensityControl ()
String getLightName ()
LightType getLightType ()
Number getNumShaders ()
DzRSLShader getShader (Number index)
String getShadowMapPath ()
Boolean removeShader (DzRSLShader shader)
void setDefinitionFile (String definitionFile)
void setLightName (String name)
void setLightType (LightType lightType)
void setUseLocalShaderSpace (Boolean onOff)
Boolean usesLocalShaderSpace ()

Constructors

 DzShaderLight (String definitionFile, LightType lightType)
 DzShaderLight ()

Detailed Description

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

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


Member Enumeration Documentation

enum DzShaderLight::LightType

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


Constructor & Destructor Documentation

DzShaderLight::DzShaderLight (  ) 

Default Constructor.

DzShaderLight::DzShaderLight ( String  definitionFile,
LightType  lightType 
)

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 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 tab, the avatar representing the light in the viewport.
See also:
setDefinitionFile()


Member Function Documentation

Boolean DzShaderLight::addShader ( DzRSLShader  shader  ) 

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

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

DzColorProperty DzShaderLight::getColorControl (  ) 

Returns:
The property that controls the color of this light.

String DzShaderLight::getDefinitionFile (  ) 

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

Number DzShaderLight::getIntensity (  ) 

Returns:
The value of the property that controls the intensity of this light.

DzFloatProperty DzShaderLight::getIntensityControl (  ) 

Returns:
The property that controls the intensity of this light.

String DzShaderLight::getLightName (  ) 

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

LightType DzShaderLight::getLightType (  ) 

Returns:
The type of the light.

Number DzShaderLight::getNumShaders (  ) 

Returns:
The number of DzRSLShaders on this light

DzRSLShader DzShaderLight::getShader ( Number  index  ) 

Returns:
The DzRSLShader at index.

String DzShaderLight::getShadowMapPath (  ) 

Returns:
The path to the generated shadow map for this light.

Boolean DzShaderLight::removeShader ( DzRSLShader  shader  ) 

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

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

void DzShaderLight::setDefinitionFile ( String  definitionFile  ) 

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

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

void DzShaderLight::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 DzShaderLight::setLightType ( LightType  lightType  ) 

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

void DzShaderLight::setUseLocalShaderSpace ( Boolean  onOff  ) 

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

Example:
        NEED EXAMPLE

Boolean DzShaderLight::usesLocalShaderSpace (  ) 

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


Generated on Thu Sep 24 12:21:15 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.