The ILight video object interface. More...

#include "murl_video_i_light.h"

Inherited by Murl::Video::Light.

Public Member Functions

virtual IObjectGetObjectInterface ()=0
 Get the mutable Video::IObject interface. More...
 
virtual const IObjectGetObjectInterface () const =0
 Get the constant Video::IObject interface. More...
 
virtual Bool Enable (UInt32 unit)=0
 Enable the light at a given unit. More...
 
virtual Bool Disable (UInt32 unit)=0
 Disable the light at a given unit. More...
 
virtual Bool Set (IProgram *currentProgram, UInt32 unit)=0
 Attach the light to the current GPU program at a given unit. More...
 
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...
 
virtual Bool SetIntensity (Real intensity)=0
 Set the light intensity. More...
 
virtual Real GetIntensity () const =0
 Get the light intensity. 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 SetAttenuation (const Vector &values)=0
 Set the light attenuation parameters and maximum distance. More...
 
virtual Bool SetAttenuation (Real constant, Real linear, Real quadratic, Real maxDistance)=0
 Set the light attenuation parameters and maximum distance. 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 Bool SetMaxDistance (Real value)=0
 Set the light's maximum influence radius. More...
 
virtual const VectorGetAttenuation () const =0
 Get the light attenuation parameters and maximum distance. 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 Real GetMaxDistance () const =0
 Get the light's maximum influence radius. 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 SetWorldTransform (const Matrix &transform)=0
 Set the light's current world transform. More...
 
virtual Bool SetLightProjection (const Matrix &projection)=0
 Set the light's projection matrix. More...
 
virtual Bool SetShadowViewProjection (const Matrix &viewProjection, UInt32 cascadeIndex)=0
 Set the light's shadow view/projection matrix for a given cascade. More...
 
virtual const VectorGetWorldPosition () const =0
 Get the current light position in world space. More...
 
virtual const VectorGetWorldDirection () const =0
 Get the current light direction in world space. More...
 
virtual const MatrixGetWorldTransform () const =0
 Get the light's current world transform. More...
 
virtual const MatrixGetLightProjection () const =0
 Get the light's projection matrix. More...
 
virtual const MatrixGetLightView () const =0
 Get the light's current view matrix. More...
 
virtual const MatrixGetLightViewProjection () const =0
 Get the light's combined current view and projection matrix. More...
 
virtual const MatrixGetShadowViewProjection (UInt32 cascadeIndex) const =0
 Get the light's combined current shadow view and projection matrix for a given cascade. More...
 
virtual Rectangle CalculateScreenArea (const ICamera *camera)=0
 Calculate the screen area affected by the light with respect to a camera. More...
 

Detailed Description

The ILight video object interface.

This interface represents a light source used during rendering.

Used internally by Graph::Light.

Member Function Documentation

◆ GetObjectInterface() [1/2]

virtual IObject* Murl::Video::ILight::GetObjectInterface ( )
pure virtual

Get the mutable Video::IObject interface.

Returns
The IObject interface.

◆ GetObjectInterface() [2/2]

virtual const IObject* Murl::Video::ILight::GetObjectInterface ( ) const
pure virtual

Get the constant Video::IObject interface.

Returns
The IObject interface.

◆ Enable()

virtual Bool Murl::Video::ILight::Enable ( UInt32  unit)
pure virtual

Enable the light at a given unit.

Parameters
unitThe light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
Returns
true if successful.

◆ Disable()

virtual Bool Murl::Video::ILight::Disable ( UInt32  unit)
pure virtual

Disable the light at a given unit.

Parameters
unitThe light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
Returns
true if successful.

◆ Set()

virtual Bool Murl::Video::ILight::Set ( IProgram currentProgram,
UInt32  unit 
)
pure virtual

Attach the light to the current GPU program at a given unit.

Parameters
currentProgramThe current GPU program.
unitThe light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
Returns
true if successful.

◆ SetColor()

virtual Bool Murl::Video::ILight::SetColor ( IEnums::LightingComponent  component,
const Color color 
)
pure virtual

Set the color value of a given lighting component.

Parameters
componentThe lighting component.
colorThe color to set.
Returns
true if successful.

◆ GetColor()

virtual const Color& Murl::Video::ILight::GetColor ( IEnums::LightingComponent  component) const
pure virtual

Get the color value set for a given lighting component.

Parameters
componentThe lighting component.
Returns
The current color.

◆ SetIntensity()

virtual Bool Murl::Video::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::Video::ILight::GetIntensity ( ) const
pure virtual

Get the light intensity.

Returns
The light intensity.

◆ SetType()

virtual Bool Murl::Video::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::Video::ILight::GetType ( ) const
pure virtual

Get the light type.

Returns
The light type.

◆ SetShape()

virtual Bool Murl::Video::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::Video::ILight::GetShape ( ) const
pure virtual

Get the light shape.

Returns
The light shape.

◆ SetAttenuation() [1/2]

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

Set the light attenuation parameters and maximum distance.

This method sets all three light attenuation parameters (constant, linear and quadratic), packed into a given vector's X, Y and Z components, respectively. In addition, the maximum distance contained in the vector's W component is also set.

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

◆ SetAttenuation() [2/2]

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

Set the light attenuation parameters and maximum distance.

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

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

◆ SetConstantAttenuation()

virtual Bool Murl::Video::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::Video::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::Video::ILight::SetQuadraticAttenuation ( Real  value)
pure virtual

Set the quadratic light attenuation parameter.

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

◆ SetMaxDistance()

virtual Bool Murl::Video::ILight::SetMaxDistance ( Real  value)
pure virtual

Set the light's maximum influence radius.

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

◆ GetAttenuation()

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

Get the light attenuation parameters and maximum distance.

Returns
A vector holding the light attenuation parameters, packed into its X, Y and Z components, and the maximum distance in the W component.

◆ GetConstantAttenuation()

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

Get the constant light attenuation parameter.

Returns
The constant light attenuation value.

◆ GetLinearAttenuation()

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

Get the linear light attenuation parameter.

Returns
The linear light attenuation value.

◆ GetQuadraticAttenuation()

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

Get the quadratic light attenuation parameter.

Returns
The quadratic light attenuation value.

◆ GetMaxDistance()

virtual Real Murl::Video::ILight::GetMaxDistance ( ) const
pure virtual

Get the light's maximum influence radius.

Returns
The radius of the bounding sphere.

◆ SetSpot() [1/2]

virtual Bool Murl::Video::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::Video::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::Video::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::Video::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()

virtual const Vector& Murl::Video::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::Video::ILight::GetSpotExponent ( ) const
pure virtual

Get the spot exponent value.

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

◆ GetSpotCutoffAngle()

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

Get the spot cutoff angle in radians.

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

◆ SetWorldTransform()

virtual Bool Murl::Video::ILight::SetWorldTransform ( const Matrix transform)
pure virtual

Set the light's current world transform.

Parameters
transformThe current world transform.
Returns
true if successful.

◆ SetLightProjection()

virtual Bool Murl::Video::ILight::SetLightProjection ( const Matrix projection)
pure virtual

Set the light's projection matrix.

Parameters
projectionThe projection matrix.
Returns
true if successful.

◆ SetShadowViewProjection()

virtual Bool Murl::Video::ILight::SetShadowViewProjection ( const Matrix viewProjection,
UInt32  cascadeIndex 
)
pure virtual

Set the light's shadow view/projection matrix for a given cascade.

Parameters
viewProjectionThe view/projection matrix.
cascadeIndexThe cascade index, in the range [0..3]
Returns
true if successful.

◆ GetWorldPosition()

virtual const Vector& Murl::Video::ILight::GetWorldPosition ( ) const
pure virtual

Get the current light position in world space.

Returns
The current light position.

◆ GetWorldDirection()

virtual const Vector& Murl::Video::ILight::GetWorldDirection ( ) const
pure virtual

Get the current light direction in world space.

Returns
The current light direction.

◆ GetWorldTransform()

virtual const Matrix& Murl::Video::ILight::GetWorldTransform ( ) const
pure virtual

Get the light's current world transform.

Returns
The current world transform.

◆ GetLightProjection()

virtual const Matrix& Murl::Video::ILight::GetLightProjection ( ) const
pure virtual

Get the light's projection matrix.

Returns
The projection matrix.

◆ GetLightView()

virtual const Matrix& Murl::Video::ILight::GetLightView ( ) const
pure virtual

Get the light's current view matrix.

This equals the inverse of the current world transform.

Returns
The current view matrix.

◆ GetLightViewProjection()

virtual const Matrix& Murl::Video::ILight::GetLightViewProjection ( ) const
pure virtual

Get the light's combined current view and projection matrix.

Returns
The current view/projection matrix.

◆ GetShadowViewProjection()

virtual const Matrix& Murl::Video::ILight::GetShadowViewProjection ( UInt32  cascadeIndex) const
pure virtual

Get the light's combined current shadow view and projection matrix for a given cascade.

Parameters
cascadeIndexThe cascade index, in the range [0..3]
Returns
The current shadow view/projection matrix.

◆ CalculateScreenArea()

virtual Rectangle Murl::Video::ILight::CalculateScreenArea ( const ICamera camera)
pure virtual

Calculate the screen area affected by the light with respect to a camera.

Parameters
cameraThe camera.
Returns
A rectangle of the affected screen area.

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


Copyright © 2011-2018 Spraylight GmbH.