Inheritance diagram for DzShaderLight:
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 () |
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().
DzShaderLight::DzShaderLight | ( | ) |
Default Constructor.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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. |
Boolean DzShaderLight::addShader | ( | DzRSLShader | shader | ) |
Adds shader to this light's internal list of shaders and sets shader 's owner to this light.
true
if shader is successfully added to the list (e.g. does not already exist), otherwise false
. DzColorProperty DzShaderLight::getColorControl | ( | ) |
String DzShaderLight::getDefinitionFile | ( | ) |
Number DzShaderLight::getIntensity | ( | ) |
DzFloatProperty DzShaderLight::getIntensityControl | ( | ) |
String DzShaderLight::getLightName | ( | ) |
LightType DzShaderLight::getLightType | ( | ) |
Number DzShaderLight::getNumShaders | ( | ) |
DzRSLShader DzShaderLight::getShader | ( | Number | index | ) |
String DzShaderLight::getShadowMapPath | ( | ) |
Boolean DzShaderLight::removeShader | ( | DzRSLShader | shader | ) |
Removes shader from this light's internal list of shaders.
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.
definitionFile | The relative path [from the /scripts folder] to the DAZ Script that creates this light's property list |
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.
NEED EXAMPLE
Boolean DzShaderLight::usesLocalShaderSpace | ( | ) |
false
by default