The ILight graph node interface. More...
#include "murl_graph_i_light.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant INode interface. More... | |
virtual ISubject * | GetSubjectInterface ()=0 |
Get the mutable ISubject interface. More... | |
virtual const ISubject * | GetSubjectInterface () const =0 |
Get the constant ISubject interface. More... | |
virtual ILightNodeTarget * | GetSubLightNodeTarget ()=0 |
Get the mutable container holding the optional child lights. More... | |
virtual const ILightNodeTarget * | GetSubLightNodeTarget () const =0 |
Get the constant container holding the optional child lights. More... | |
virtual ITextureNodeTarget * | GetTextureNodeTarget ()=0 |
Get the mutable Graph::ITextureNodeTarget container. More... | |
virtual const ITextureNodeTarget * | GetTextureNodeTarget () 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 Vector & | GetAttenuation () 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 Vector & | GetSpot () 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 IBoundingVolume * | GetBoundingVolume (UInt32 stage)=0 |
Get the light's bounding volume for a given stage. More... | |
virtual const IBoundingVolume * | GetBoundingVolume (UInt32 stage) const =0 |
Get the light's bounding volume for a given stage. More... | |
virtual const Matrix * | GetWorldTransform (UInt32 stage) const =0 |
Get the light's world transform for a given stage. More... | |
virtual const Vector * | GetAttenuation (UInt32 stage) const =0 |
Get the light attenuation parameters for a given stage. More... | |
virtual const Vector * | GetSpot (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::ILight * | GetVideoLightObject (UInt32 stage) const =0 |
Get the light's internal video renderer object. More... | |
virtual Video::ITexture * | GetVideoTextureObject (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 Color & | GetColor (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]
|
pure virtual |
◆ GetNodeInterface() [2/2]
|
pure virtual |
◆ GetSubjectInterface() [1/2]
|
pure virtual |
◆ GetSubjectInterface() [2/2]
|
pure virtual |
◆ GetSubLightNodeTarget() [1/2]
|
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]
|
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]
|
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]
|
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()
|
pure virtual |
Set the light type.
This method sets the type of light, either directional, point or spot light.
- Parameters
-
type The light type to set.
- Returns
- true if successful.
◆ GetType()
|
pure virtual |
Get the light type.
- Returns
- The light type.
◆ SetShape()
|
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
-
shape The light shape to set.
- Returns
- true if successful.
◆ GetShape()
|
pure virtual |
Get the light shape.
- Returns
- The light shape.
◆ SetIntensity()
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
-
intensity The light intensity to set.
- Returns
- true if successful.
◆ GetIntensity()
|
pure virtual |
Get the light intensity.
- Returns
- The light intensity.
◆ SetAttenuation() [1/2]
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
-
values A vector holding the light attenuation parameters.
- Returns
- true if successful.
◆ SetAttenuation() [2/2]
|
pure virtual |
Set the light attenuation parameters.
This method sets all three light attenuation parameters (constant, linear and quadratic), given as individual values.
- Parameters
-
constant The constant light attenuation value. linear The linear light attenuation value. quadratic The quadratic light attenuation value.
- Returns
- true if successful.
◆ SetConstantAttenuation()
Set the constant light attenuation parameter.
- Parameters
-
value The constant light attenuation value.
- Returns
- true if successful.
◆ SetLinearAttenuation()
Set the linear light attenuation parameter.
- Parameters
-
value The linear light attenuation value.
- Returns
- true if successful.
◆ SetQuadraticAttenuation()
Set the quadratic light attenuation parameter.
- Parameters
-
value The quadratic light attenuation value.
- Returns
- true if successful.
◆ GetAttenuation() [1/2]
|
pure virtual |
Get the light attenuation parameters.
- Returns
- A vector holding the light attenuation parameters, packed into its X, Y and Z components.
◆ GetConstantAttenuation()
|
pure virtual |
Get the constant light attenuation parameter.
- Returns
- The constant light attenuation value.
◆ GetLinearAttenuation()
|
pure virtual |
Get the linear light attenuation parameter.
- Returns
- The linear light attenuation value.
◆ GetQuadraticAttenuation()
|
pure virtual |
Get the quadratic light attenuation parameter.
- Returns
- The quadratic light attenuation value.
◆ SetSpot() [1/2]
Set the combined spot exponent and cutoff angle value.
- Parameters
-
values 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.
- Returns
- true if successful.
◆ SetSpot() [2/2]
Set the spot exponent and cutoff angle value.
- Parameters
-
exponent The spot exponent value in the range [0, 128]. cutoffAngle The spot cutoff angle in the range [0, PI/2] radians.
- Returns
- true if successful.
◆ SetSpotExponent()
Set the spot exponent value.
- Parameters
-
exponent The spot exponent value in the range [0, 128].
- Returns
- true if successful.
◆ SetSpotCutoffAngle()
Set the spot cutoff angle in degrees.
- Parameters
-
cutoffAngle The spot cutoff angle in the range [0, PI/2].
- Returns
- true if successful.
◆ GetSpot() [1/2]
|
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()
|
pure virtual |
Get the spot exponent value.
- Returns
- The spot exponent value in the range [0, 128].
◆ GetSpotCutoffAngle()
|
pure virtual |
Get the spot cutoff angle in radians.
- Returns
- The spot cutoff angle in the range [0, PI/2].
◆ SetAspectRatio()
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
-
ratio The X:Y aspect ratio.
- Returns
- true if successful.
◆ GetAspectRatio()
|
pure virtual |
Get the current aspect ratio.
- Returns
- The X:Y aspect ratio.
◆ SetFieldOfView()
Set the field of view at the minimum distance.
This method sets both the horizontal and vertical field of view values. See SetAspectRatio().
- Parameters
-
fovX The horizontal field of view. fovY The vertical field of view.
- Returns
- true if successful.
◆ SetFieldOfViewX()
Set the horizontal field of view, at the minimum distance.
See SetAspectRatio().
- Parameters
-
fovX The horizontal field of view.
- Returns
- true if successful.
◆ SetFieldOfViewY()
Set the vertical field of view, at the minimum distance.
See SetAspectRatio().
- Parameters
-
fovY The vertical field of view.
- Returns
- true if successful.
◆ GetFieldOfViewX()
|
pure virtual |
Get the horizontal field of view.
- Returns
- The horizontal field of view, or 0.0 if variable.
◆ GetFieldOfViewY()
|
pure virtual |
Get the vertical field of view.
- Returns
- The vertical field of view, or 0.0 if variable.
◆ SetMinDistance()
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
-
distance The minimum distance.
- Returns
- true if successful.
◆ SetMaxDistance()
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
-
distance The radius of the bounding sphere.
- Returns
- true if successful.
◆ GetNearestStages()
|
pure virtual |
Get the stage indices of the N nearest sub-lights.
- Parameters
-
boundingVolume The bounding volume to check the sub-lights against. stageIndices A reference to an array of stage indices to write to. maxStages The size of the output array.
- Returns
- The actual number of stage indices written.
◆ GetNumberOfStages()
|
pure virtual |
Get the light's number of stages.
- Returns
- The number of stages.
◆ GetBoundingVolume() [1/2]
|
pure virtual |
Get the light's bounding volume for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- The bounding volume, or null if the light has infinite influence.
◆ GetBoundingVolume() [2/2]
|
pure virtual |
Get the light's bounding volume for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- The bounding volume, or null if the light has infinite influence.
◆ GetWorldTransform()
Get the light's world transform for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- The world transform matrix, or null if not available.
◆ GetAttenuation() [2/2]
Get the light attenuation parameters for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- A vector holding the light attenuation parameters, packed into its X, Y and Z components.
◆ GetSpot() [2/2]
Get the combined spot exponent and cutoff angle value for a given stage.
- Parameters
-
stage The 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()
Get the light's minimum influence distance for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- The minimum distance.
◆ GetMaxDistance()
Get the light's maximum influence radius for a given stage.
- Parameters
-
stage The stage to query.
- Returns
- The maximum distance.
◆ GetVideoLightObject()
|
pure virtual |
Get the light's internal video renderer object.
- Parameters
-
stage The stage to query.
- Returns
- The video renderer object.
◆ GetVideoTextureObject()
|
pure virtual |
Get the light's internal projected renderer texture.
- Parameters
-
stage The stage to query.
- Returns
- The video renderer texture.
The documentation for this interface was generated from the following file:
- murl_graph_i_light.h