![]() |
Murl Engine API
Version 2018.3
|
The ILight graph node interface. More...
#include <murl_graph_i_light.h>
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:
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.
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... | |
![]() | |
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... | |
![]() | |
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... | |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
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.
|
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.
|
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.
|
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.
|
pure virtual |
Set the light type.
This method sets the type of light, either directional, point or spot light.
type | The light type to set. |
|
pure virtual |
Get the light type.
|
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.
shape | The light shape to set. |
|
pure virtual |
Get the light shape.
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.
intensity | The light intensity to set. |
|
pure virtual |
Get the light intensity.
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.
values | A vector holding the light attenuation parameters. |
|
pure virtual |
Set the light attenuation parameters.
This method sets all three light attenuation parameters (constant, linear and quadratic), given as individual values.
constant | The constant light attenuation value. |
linear | The linear light attenuation value. |
quadratic | The quadratic light attenuation value. |
Set the constant light attenuation parameter.
value | The constant light attenuation value. |
Set the linear light attenuation parameter.
value | The linear light attenuation value. |
Set the quadratic light attenuation parameter.
value | The quadratic light attenuation value. |
|
pure virtual |
Get the light attenuation parameters.
|
pure virtual |
Get the constant light attenuation parameter.
|
pure virtual |
Get the linear light attenuation parameter.
|
pure virtual |
Get the quadratic light attenuation parameter.
Set the combined spot exponent and cutoff angle value.
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. |
Set the spot exponent and cutoff angle value.
exponent | The spot exponent value in the range [0, 128]. |
cutoffAngle | The spot cutoff angle in the range [0, PI/2] radians. |
Set the spot exponent value.
exponent | The spot exponent value in the range [0, 128]. |
Set the spot cutoff angle in degrees.
cutoffAngle | The spot cutoff angle in the range [0, PI/2]. |
|
pure virtual |
Get the combined spot exponent and cutoff angle value.
|
pure virtual |
Get the spot exponent value.
|
pure virtual |
Get the spot cutoff angle in radians.
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.
ratio | The X:Y aspect ratio. |
|
pure virtual |
Get the current aspect ratio.
Set the field of view at the minimum distance.
This method sets both the horizontal and vertical field of view values. See SetAspectRatio().
fovX | The horizontal field of view. |
fovY | The vertical field of view. |
Set the horizontal field of view, at the minimum distance.
See SetAspectRatio().
fovX | The horizontal field of view. |
Set the vertical field of view, at the minimum distance.
See SetAspectRatio().
fovY | The vertical field of view. |
|
pure virtual |
Get the horizontal field of view.
|
pure virtual |
Get the vertical field of view.
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.
distance | The minimum distance. |
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.
distance | The radius of the bounding sphere. |
|
pure virtual |
Get the stage indices of the N nearest sub-lights.
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. |
|
pure virtual |
Get the light's number of stages.
|
pure virtual |
Get the light's bounding volume for a given stage.
stage | The stage to query. |
|
pure virtual |
Get the light's bounding volume for a given stage.
stage | The stage to query. |
Get the light's world transform for a given stage.
stage | The stage to query. |
Get the light attenuation parameters for a given stage.
stage | The stage to query. |
Get the combined spot exponent and cutoff angle value for a given stage.
stage | The stage to query. |
Get the light's minimum influence distance for a given stage.
stage | The stage to query. |
Get the light's maximum influence radius for a given stage.
stage | The stage to query. |
|
pure virtual |
Get the light's internal video renderer object.
stage | The stage to query. |
|
pure virtual |
Get the light's internal projected renderer texture.
stage | The stage to query. |