The ILight graph node interface. More...

#include "murl_graph_i_light.h"

Inheritance diagram for Murl::Graph::ILight:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant INode interface. More...
 
virtual ISubjectGetSubjectInterface ()=0
 Get the mutable ISubject interface. More...
 
virtual const ISubjectGetSubjectInterface () const =0
 Get the constant ISubject interface. More...
 
virtual ILightNodeTargetGetSubLightNodeTarget ()=0
 Get the mutable container holding the optional child lights. More...
 
virtual const ILightNodeTargetGetSubLightNodeTarget () const =0
 Get the constant container holding the optional child lights. More...
 
virtual ITextureNodeTargetGetTextureNodeTarget ()=0
 Get the mutable Graph::ITextureNodeTarget container. More...
 
virtual const ITextureNodeTargetGetTextureNodeTarget () const =0
 Get the constant Graph::ITextureNodeTarget container. More...
 
virtual Bool SetType (IEnums::LightType type)=0
 Set the light type. More...
 
virtual IEnums::LightType GetType () const =0
 Get the light type. More...
 
virtual Bool SetShape (IEnums::LightShape shape)=0
 Set the light shape. More...
 
virtual IEnums::LightShape GetShape () const =0
 Get the light shape. More...
 
virtual Bool SetIntensity (Real intensity)=0
 Set the light intensity. More...
 
virtual Real GetIntensity () const =0
 Get the light intensity. More...
 
virtual Bool SetAttenuation (const Vector &values)=0
 Set the light attenuation parameters. More...
 
virtual Bool SetAttenuation (Real constant, Real linear, Real quadratic)=0
 Set the light attenuation parameters. More...
 
virtual Bool SetConstantAttenuation (Real value)=0
 Set the constant light attenuation parameter. More...
 
virtual Bool SetLinearAttenuation (Real value)=0
 Set the linear light attenuation parameter. More...
 
virtual Bool SetQuadraticAttenuation (Real value)=0
 Set the quadratic light attenuation parameter. More...
 
virtual const VectorGetAttenuation () const =0
 Get the light attenuation parameters. More...
 
virtual Real GetConstantAttenuation () const =0
 Get the constant light attenuation parameter. More...
 
virtual Real GetLinearAttenuation () const =0
 Get the linear light attenuation parameter. More...
 
virtual Real GetQuadraticAttenuation () const =0
 Get the quadratic light attenuation parameter. More...
 
virtual Bool SetSpot (const Vector &values)=0
 Set the combined spot exponent and cutoff angle value. More...
 
virtual Bool SetSpot (Real exponent, Real cutoffAngle)=0
 Set the spot exponent and cutoff angle value. More...
 
virtual Bool SetSpotExponent (Real exponent)=0
 Set the spot exponent value. More...
 
virtual Bool SetSpotCutoffAngle (Real cutoffAngle)=0
 Set the spot cutoff angle in degrees. More...
 
virtual const VectorGetSpot () const =0
 Get the combined spot exponent and cutoff angle value. More...
 
virtual Real GetSpotExponent () const =0
 Get the spot exponent value. More...
 
virtual Real GetSpotCutoffAngle () const =0
 Get the spot cutoff angle in radians. More...
 
virtual Bool SetAspectRatio (Real ratio)=0
 Set the light's aspect ratio used for shadow maps. More...
 
virtual Real GetAspectRatio () const =0
 Get the current aspect ratio. More...
 
virtual Bool SetFieldOfView (Real fovX, Real fovY)=0
 Set the field of view at the minimum distance. More...
 
virtual Bool SetFieldOfViewX (Real fovX)=0
 Set the horizontal field of view, at the minimum distance. More...
 
virtual Bool SetFieldOfViewY (Real fovY)=0
 Set the vertical field of view, at the minimum distance. More...
 
virtual Real GetFieldOfViewX () const =0
 Get the horizontal field of view. More...
 
virtual Real GetFieldOfViewY () const =0
 Get the vertical field of view. More...
 
virtual Bool SetMinDistance (Real distance)=0
 Set the light's minimum influence radius. More...
 
virtual Bool SetMaxDistance (Real distance)=0
 Set the light's maximum influence radius. More...
 
virtual UInt32 GetNearestStages (const IBoundingVolume *boundingVolume, Array< UInt32 > &stageIndices, UInt32 maxStages) const =0
 Get the stage indices of the N nearest sub-lights. More...
 
virtual UInt32 GetNumberOfStages () const =0
 Get the light's number of stages. More...
 
virtual IBoundingVolumeGetBoundingVolume (UInt32 stage)=0
 Get the light's bounding volume for a given stage. More...
 
virtual const IBoundingVolumeGetBoundingVolume (UInt32 stage) const =0
 Get the light's bounding volume for a given stage. More...
 
virtual const MatrixGetWorldTransform (UInt32 stage) const =0
 Get the light's world transform for a given stage. More...
 
virtual const VectorGetAttenuation (UInt32 stage) const =0
 Get the light attenuation parameters for a given stage. More...
 
virtual const VectorGetSpot (UInt32 stage) const =0
 Get the combined spot exponent and cutoff angle value for a given stage. More...
 
virtual Real GetMinDistance (UInt32 stage) const =0
 Get the light's minimum influence distance for a given stage. More...
 
virtual Real GetMaxDistance (UInt32 stage) const =0
 Get the light's maximum influence radius for a given stage. More...
 
virtual Video::ILightGetVideoLightObject (UInt32 stage) const =0
 Get the light's internal video renderer object. More...
 
virtual Video::ITextureGetVideoTextureObject (UInt32 stage) const =0
 Get the light's internal projected renderer texture. More...
 
- Public Member Functions inherited from Murl::Graph::IColored
virtual Bool SetColor (IEnums::LightingComponent component, const Color &color)=0
 Set the color value of a given lighting component. More...
 
virtual const ColorGetColor (IEnums::LightingComponent component) const =0
 Get the color value set for a given lighting component. More...
 
- Public Member Functions inherited from Murl::Graph::IStateUnit
virtual Bool SetUnit (UInt32 unit)=0
 Set the unit index to use. More...
 
virtual UInt32 GetUnit () const =0
 Get the unit index to use. More...
 

Detailed Description

The ILight graph node interface.

This interface represents a light source in world space. The light's position and direction cannot be specified directly; instead, a separate ILightTransform node must be used that references the ILight node it is supposed to move/rotate.

To enable colored light, the SetColor() method of the Graph::IColored base interface can be used.

By default, the light source's direction runs along the negative Z axis, i.e. parallel to the default camera viewing direction. The default position is (0/0/0). Depending on the actual type of this light source, either the light's position, direction, or both are used for lighting calculations:

  • DIRECTIONAL: Only direction is used. The light's position is ignored, resulting in parallel light rays, like a light source inifinitely far away.
  • POINT: Only position is used, with light rays emitted in all directions from that point.
  • SPOT: Light rays are emitted from the given point, in the given direction.

See Output-States, Slots und Units for an overview of state handling during scene graph traversal.
See Graph::ILightTransform for setting a light's position and orientation.
See Graph::ILightState for activating lights for rendering.

Member Function Documentation

◆ GetNodeInterface() [1/2]

virtual INode* Murl::Graph::ILight::GetNodeInterface ( )
pure virtual

Get the mutable INode interface.

This method returns a mutable pointer to the node's INode interface, to be able to query or modify common node properties such as active state, visibility or ID.

Returns
The mutable INode interface, or null if not available.

◆ GetNodeInterface() [2/2]

virtual const INode* Murl::Graph::ILight::GetNodeInterface ( ) const
pure virtual

Get the constant INode interface.

This method returns a constant pointer to the node's INode interface, to be able to query common node properties such as active state, visibility or ID.

Returns
The constant INode interface, or null if not available.

◆ GetSubjectInterface() [1/2]

virtual ISubject* Murl::Graph::ILight::GetSubjectInterface ( )
pure virtual

Get the mutable ISubject interface.

This method returns a mutable pointer to the node's ISubject interface, to be able to query or modify subject properties such as world transform, viewing matrix, projection matrix etc.

Returns
The mutable ISubject interface, or null if not available

◆ GetSubjectInterface() [2/2]

virtual const ISubject* Murl::Graph::ILight::GetSubjectInterface ( ) const
pure virtual

Get the constant ISubject interface.

This method returns a constant pointer to the node's ISubject interface, to be able to query subject properties such as world transform, viewing matrix, projection matrix etc.

Returns
The mutable ISubject interface, or null if not available

◆ GetSubLightNodeTarget() [1/2]

virtual ILightNodeTarget* Murl::Graph::ILight::GetSubLightNodeTarget ( )
pure virtual

Get the mutable container holding the optional child lights.

This method returns a mutable pointer to the node's Graph::ILightNodeTarget sub container, which is used to store multiple sub-lights.

Returns
The mutable Graph::ILightNodeTarget container, or null if not available.

◆ GetSubLightNodeTarget() [2/2]

virtual const ILightNodeTarget* Murl::Graph::ILight::GetSubLightNodeTarget ( ) const
pure virtual

Get the constant container holding the optional child lights.

This method returns a constant pointer to the node's Graph::ILightNodeTarget sub container, which is used to store multiple sub-lights.

Returns
The constant Graph::ILightNodeTarget container, or null if not available.

◆ GetTextureNodeTarget() [1/2]

virtual ITextureNodeTarget* Murl::Graph::ILight::GetTextureNodeTarget ( )
pure virtual

Get the mutable Graph::ITextureNodeTarget container.

This method returns a mutable pointer to the node's Graph::ITextureNodeTarget container, which allows to set or query an optional texture to project onto the geometry affected by the light.

Returns
The mutable Graph::ITextureNodeTarget container, or null if not available.

◆ GetTextureNodeTarget() [2/2]

virtual const ITextureNodeTarget* Murl::Graph::ILight::GetTextureNodeTarget ( ) const
pure virtual

Get the constant Graph::ITextureNodeTarget container.

This method returns a constant pointer to the node's Graph::ITextureNodeTarget container, which allows to query an optional texture to project onto the geometry affected by the light.

Returns
The mutable Graph::ITextureNodeTarget container, or null if not available.

◆ SetType()

virtual Bool Murl::Graph::ILight::SetType ( IEnums::LightType  type)
pure virtual

Set the light type.

This method sets the type of light, either directional, point or spot light.

Parameters
typeThe light type to set.
Returns
true if successful.

◆ GetType()

virtual IEnums::LightType Murl::Graph::ILight::GetType ( ) const
pure virtual

Get the light type.

Returns
The light type.

◆ SetShape()

virtual Bool Murl::Graph::ILight::SetShape ( IEnums::LightShape  shape)
pure virtual

Set the light shape.

This method sets the shape of the light's projection. This is only useful when a projected light texture is used.

Parameters
shapeThe light shape to set.
Returns
true if successful.

◆ GetShape()

virtual IEnums::LightShape Murl::Graph::ILight::GetShape ( ) const
pure virtual

Get the light shape.

Returns
The light shape.

◆ SetIntensity()

virtual Bool Murl::Graph::ILight::SetIntensity ( Real  intensity)
pure virtual

Set the light intensity.

The light intensity can be queried in a shader via the uLightSpotN.z uniform variable, with N being the light unit where the light is currently bound. By default, the intensity is set to 1.0.

Parameters
intensityThe light intensity to set.
Returns
true if successful.

◆ GetIntensity()

virtual Real Murl::Graph::ILight::GetIntensity ( ) const
pure virtual

Get the light intensity.

Returns
The light intensity.

◆ SetAttenuation() [1/2]

virtual Bool Murl::Graph::ILight::SetAttenuation ( const Vector values)
pure virtual

Set the light attenuation parameters.

This method sets all three light attenuation parameters (constant, linear and quadratic), packed into a given vector's X, Y and Z components, respectively.

Parameters
valuesA vector holding the light attenuation parameters.
Returns
true if successful.

◆ SetAttenuation() [2/2]

virtual Bool Murl::Graph::ILight::SetAttenuation ( Real  constant,
Real  linear,
Real  quadratic 
)
pure virtual

Set the light attenuation parameters.

This method sets all three light attenuation parameters (constant, linear and quadratic), given as individual values.

Parameters
constantThe constant light attenuation value.
linearThe linear light attenuation value.
quadraticThe quadratic light attenuation value.
Returns
true if successful.

◆ SetConstantAttenuation()

virtual Bool Murl::Graph::ILight::SetConstantAttenuation ( Real  value)
pure virtual

Set the constant light attenuation parameter.

Parameters
valueThe constant light attenuation value.
Returns
true if successful.

◆ SetLinearAttenuation()

virtual Bool Murl::Graph::ILight::SetLinearAttenuation ( Real  value)
pure virtual

Set the linear light attenuation parameter.

Parameters
valueThe linear light attenuation value.
Returns
true if successful.

◆ SetQuadraticAttenuation()

virtual Bool Murl::Graph::ILight::SetQuadraticAttenuation ( Real  value)
pure virtual

Set the quadratic light attenuation parameter.

Parameters
valueThe quadratic light attenuation value.
Returns
true if successful.

◆ GetAttenuation() [1/2]

virtual const Vector& Murl::Graph::ILight::GetAttenuation ( ) const
pure virtual

Get the light attenuation parameters.

Returns
A vector holding the light attenuation parameters, packed into its X, Y and Z components.

◆ GetConstantAttenuation()

virtual Real Murl::Graph::ILight::GetConstantAttenuation ( ) const
pure virtual

Get the constant light attenuation parameter.

Returns
The constant light attenuation value.

◆ GetLinearAttenuation()

virtual Real Murl::Graph::ILight::GetLinearAttenuation ( ) const
pure virtual

Get the linear light attenuation parameter.

Returns
The linear light attenuation value.

◆ GetQuadraticAttenuation()

virtual Real Murl::Graph::ILight::GetQuadraticAttenuation ( ) const
pure virtual

Get the quadratic light attenuation parameter.

Returns
The quadratic light attenuation value.

◆ SetSpot() [1/2]

virtual Bool Murl::Graph::ILight::SetSpot ( const Vector values)
pure virtual

Set the combined spot exponent and cutoff angle value.

Parameters
valuesA vector containing the spot exponent value in the range [0, 128] in the X component, and the spot cutoff angle in the range [0, PI/2] radians in the Y component.
Returns
true if successful.

◆ SetSpot() [2/2]

virtual Bool Murl::Graph::ILight::SetSpot ( Real  exponent,
Real  cutoffAngle 
)
pure virtual

Set the spot exponent and cutoff angle value.

Parameters
exponentThe spot exponent value in the range [0, 128].
cutoffAngleThe spot cutoff angle in the range [0, PI/2] radians.
Returns
true if successful.

◆ SetSpotExponent()

virtual Bool Murl::Graph::ILight::SetSpotExponent ( Real  exponent)
pure virtual

Set the spot exponent value.

Parameters
exponentThe spot exponent value in the range [0, 128].
Returns
true if successful.

◆ SetSpotCutoffAngle()

virtual Bool Murl::Graph::ILight::SetSpotCutoffAngle ( Real  cutoffAngle)
pure virtual

Set the spot cutoff angle in degrees.

Parameters
cutoffAngleThe spot cutoff angle in the range [0, PI/2].
Returns
true if successful.

◆ GetSpot() [1/2]

virtual const Vector& Murl::Graph::ILight::GetSpot ( ) const
pure virtual

Get the combined spot exponent and cutoff angle value.

Returns
A constant reference to a vector containing the spot exponent value in the range [0, 128] in the X component, and the spot cutoff angle in the range [0, PI/2] radians in the Y component.

◆ GetSpotExponent()

virtual Real Murl::Graph::ILight::GetSpotExponent ( ) const
pure virtual

Get the spot exponent value.

Returns
The spot exponent value in the range [0, 128].

◆ GetSpotCutoffAngle()

virtual Real Murl::Graph::ILight::GetSpotCutoffAngle ( ) const
pure virtual

Get the spot cutoff angle in radians.

Returns
The spot cutoff angle in the range [0, PI/2].

◆ SetAspectRatio()

virtual Bool Murl::Graph::ILight::SetAspectRatio ( Real  ratio)
pure virtual

Set the light's aspect ratio used for shadow maps.

When using directional or point lights for rendering into a shadow map, this method (together with any of the SetFieldOfView methods below) can be used to define the actual volume considered for generating the shadow map.

Parameters
ratioThe X:Y aspect ratio.
Returns
true if successful.

◆ GetAspectRatio()

virtual Real Murl::Graph::ILight::GetAspectRatio ( ) const
pure virtual

Get the current aspect ratio.

Returns
The X:Y aspect ratio.

◆ SetFieldOfView()

virtual Bool Murl::Graph::ILight::SetFieldOfView ( Real  fovX,
Real  fovY 
)
pure virtual

Set the field of view at the minimum distance.

This method sets both the horizontal and vertical field of view values. See SetAspectRatio().

Parameters
fovXThe horizontal field of view.
fovYThe vertical field of view.
Returns
true if successful.

◆ SetFieldOfViewX()

virtual Bool Murl::Graph::ILight::SetFieldOfViewX ( Real  fovX)
pure virtual

Set the horizontal field of view, at the minimum distance.

See SetAspectRatio().

Parameters
fovXThe horizontal field of view.
Returns
true if successful.

◆ SetFieldOfViewY()

virtual Bool Murl::Graph::ILight::SetFieldOfViewY ( Real  fovY)
pure virtual

Set the vertical field of view, at the minimum distance.

See SetAspectRatio().

Parameters
fovYThe vertical field of view.
Returns
true if successful.

◆ GetFieldOfViewX()

virtual Real Murl::Graph::ILight::GetFieldOfViewX ( ) const
pure virtual

Get the horizontal field of view.

Returns
The horizontal field of view, or 0.0 if variable.

◆ GetFieldOfViewY()

virtual Real Murl::Graph::ILight::GetFieldOfViewY ( ) const
pure virtual

Get the vertical field of view.

Returns
The vertical field of view, or 0.0 if variable.

◆ SetMinDistance()

virtual Bool Murl::Graph::ILight::SetMinDistance ( Real  distance)
pure virtual

Set the light's minimum influence radius.

The given value only has effect when rendering a projected light texture. In this case, it represents the near plane distance of the light projection matrix.

Parameters
distanceThe minimum distance.
Returns
true if successful.

◆ SetMaxDistance()

virtual Bool Murl::Graph::ILight::SetMaxDistance ( Real  distance)
pure virtual

Set the light's maximum influence radius.

This method sets the radius of the light's bounding sphere, which is used to determine the nearest light source within a group, for every geometry object for which the respective group is active. For rendering projected light textures, this also represents the far plane of the light projection matrix.

Parameters
distanceThe radius of the bounding sphere.
Returns
true if successful.

◆ GetNearestStages()

virtual UInt32 Murl::Graph::ILight::GetNearestStages ( const IBoundingVolume boundingVolume,
Array< UInt32 > &  stageIndices,
UInt32  maxStages 
) const
pure virtual

Get the stage indices of the N nearest sub-lights.

Parameters
boundingVolumeThe bounding volume to check the sub-lights against.
stageIndicesA reference to an array of stage indices to write to.
maxStagesThe size of the output array.
Returns
The actual number of stage indices written.

◆ GetNumberOfStages()

virtual UInt32 Murl::Graph::ILight::GetNumberOfStages ( ) const
pure virtual

Get the light's number of stages.

Returns
The number of stages.

◆ GetBoundingVolume() [1/2]

virtual IBoundingVolume* Murl::Graph::ILight::GetBoundingVolume ( UInt32  stage)
pure virtual

Get the light's bounding volume for a given stage.

Parameters
stageThe stage to query.
Returns
The bounding volume, or null if the light has infinite influence.

◆ GetBoundingVolume() [2/2]

virtual const IBoundingVolume* Murl::Graph::ILight::GetBoundingVolume ( UInt32  stage) const
pure virtual

Get the light's bounding volume for a given stage.

Parameters
stageThe stage to query.
Returns
The bounding volume, or null if the light has infinite influence.

◆ GetWorldTransform()

virtual const Matrix* Murl::Graph::ILight::GetWorldTransform ( UInt32  stage) const
pure virtual

Get the light's world transform for a given stage.

Parameters
stageThe stage to query.
Returns
The world transform matrix, or null if not available.

◆ GetAttenuation() [2/2]

virtual const Vector* Murl::Graph::ILight::GetAttenuation ( UInt32  stage) const
pure virtual

Get the light attenuation parameters for a given stage.

Parameters
stageThe stage to query.
Returns
A vector holding the light attenuation parameters, packed into its X, Y and Z components.

◆ GetSpot() [2/2]

virtual const Vector* Murl::Graph::ILight::GetSpot ( UInt32  stage) const
pure virtual

Get the combined spot exponent and cutoff angle value for a given stage.

Parameters
stageThe stage to query.
Returns
A constant reference to a vector containing the spot exponent value in the range [0, 128] in the X component, and the spot cutoff angle in the range [0, 90] degrees in the Y component.

◆ GetMinDistance()

virtual Real Murl::Graph::ILight::GetMinDistance ( UInt32  stage) const
pure virtual

Get the light's minimum influence distance for a given stage.

Parameters
stageThe stage to query.
Returns
The minimum distance.

◆ GetMaxDistance()

virtual Real Murl::Graph::ILight::GetMaxDistance ( UInt32  stage) const
pure virtual

Get the light's maximum influence radius for a given stage.

Parameters
stageThe stage to query.
Returns
The maximum distance.

◆ GetVideoLightObject()

virtual Video::ILight* Murl::Graph::ILight::GetVideoLightObject ( UInt32  stage) const
pure virtual

Get the light's internal video renderer object.

Parameters
stageThe stage to query.
Returns
The video renderer object.

◆ GetVideoTextureObject()

virtual Video::ITexture* Murl::Graph::ILight::GetVideoTextureObject ( UInt32  stage) const
pure virtual

Get the light's internal projected renderer texture.

Parameters
stageThe stage to query.
Returns
The video renderer texture.

The documentation for this interface was generated from the following file:
  • murl_graph_i_light.h


Copyright © 2011-2024 Spraylight GmbH.