The ILight video object interface. More...
#include "murl_video_i_light.h"
Inherited by Murl::Video::Light.
Public Member Functions | |
virtual IObject * | GetObjectInterface ()=0 |
Get the mutable Video::IObject interface. More... | |
virtual const IObject * | GetObjectInterface () 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 Color & | GetColor (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 Vector & | GetAttenuation () 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 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 | 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 Vector & | GetWorldPosition () const =0 |
Get the current light position in world space. More... | |
virtual const Vector & | GetWorldDirection () const =0 |
Get the current light direction in world space. More... | |
virtual const Matrix & | GetWorldTransform () const =0 |
Get the light's current world transform. More... | |
virtual const Matrix & | GetLightProjection () const =0 |
Get the light's projection matrix. More... | |
virtual const Matrix & | GetLightView () const =0 |
Get the light's current view matrix. More... | |
virtual const Matrix & | GetLightViewProjection () const =0 |
Get the light's combined current view and projection matrix. More... | |
virtual const Matrix & | GetShadowViewProjection (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]
|
pure virtual |
Get the mutable Video::IObject interface.
- Returns
- The IObject interface.
◆ GetObjectInterface() [2/2]
|
pure virtual |
Get the constant Video::IObject interface.
- Returns
- The IObject interface.
◆ Enable()
Enable the light at a given unit.
- Parameters
-
unit The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
- Returns
- true if successful.
◆ Disable()
Disable the light at a given unit.
- Parameters
-
unit The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
- Returns
- true if successful.
◆ Set()
Attach the light to the current GPU program at a given unit.
- Parameters
-
currentProgram The current GPU program. unit The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1.
- Returns
- true if successful.
◆ SetColor()
|
pure virtual |
Set the color value of a given lighting component.
- Parameters
-
component The lighting component. color The color to set.
- Returns
- true if successful.
◆ GetColor()
|
pure virtual |
Get the color value set for a given lighting component.
- Parameters
-
component The lighting component.
- Returns
- The current color.
◆ 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.
◆ 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.
◆ SetAttenuation() [1/2]
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
-
values A vector holding the light attenuation and maximum distance parameters.
- Returns
- true if successful.
◆ SetAttenuation() [2/2]
|
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
-
constant The constant light attenuation value. linear The linear light attenuation value. quadratic The quadratic light attenuation value. maxDistance The maximum distance 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.
◆ SetMaxDistance()
Set the light's maximum influence radius.
- Parameters
-
value The radius of the bounding sphere.
- Returns
- true if successful.
◆ GetAttenuation()
|
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()
|
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.
◆ GetMaxDistance()
|
pure virtual |
Get the light's maximum influence radius.
- Returns
- The radius of the bounding sphere.
◆ 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()
|
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].
◆ SetWorldTransform()
Set the light's current world transform.
- Parameters
-
transform The current world transform.
- Returns
- true if successful.
◆ SetLightProjection()
Set the light's projection matrix.
- Parameters
-
projection The projection matrix.
- Returns
- true if successful.
◆ SetShadowViewProjection()
|
pure virtual |
Set the light's shadow view/projection matrix for a given cascade.
- Parameters
-
viewProjection The view/projection matrix. cascadeIndex The cascade index, in the range [0..3]
- Returns
- true if successful.
◆ GetWorldPosition()
|
pure virtual |
Get the current light position in world space.
- Returns
- The current light position.
◆ GetWorldDirection()
|
pure virtual |
Get the current light direction in world space.
- Returns
- The current light direction.
◆ GetWorldTransform()
|
pure virtual |
Get the light's current world transform.
- Returns
- The current world transform.
◆ GetLightProjection()
|
pure virtual |
Get the light's projection matrix.
- Returns
- The projection matrix.
◆ GetLightView()
|
pure virtual |
Get the light's current view matrix.
This equals the inverse of the current world transform.
- Returns
- The current view matrix.
◆ GetLightViewProjection()
|
pure virtual |
Get the light's combined current view and projection matrix.
- Returns
- The current view/projection matrix.
◆ GetShadowViewProjection()
|
pure virtual |
Get the light's combined current shadow view and projection matrix for a given cascade.
- Parameters
-
cascadeIndex The cascade index, in the range [0..3]
- Returns
- The current shadow view/projection matrix.
◆ CalculateScreenArea()
Calculate the screen area affected by the light with respect to a camera.
- Parameters
-
camera The 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