![]() |
Murl Engine API
Version 2018.3
|
The ILight video object interface. More...
#include <murl_video_i_light.h>
The ILight video object interface.
This interface represents a light source used during rendering.
Used internally by Graph::Light.
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... | |
|
pure virtual |
Get the mutable Video::IObject interface.
|
pure virtual |
Get the constant Video::IObject interface.
Enable the light at a given unit.
unit | The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1. |
Disable the light at a given unit.
unit | The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1. |
Attach the light to the current GPU program at a given unit.
currentProgram | The current GPU program. |
unit | The light unit, from 0 to IEnums::NUM_LIGHT_UNITS-1. |
|
pure virtual |
Set the color value of a given lighting component.
component | The lighting component. |
color | The color to set. |
|
pure virtual |
Get the color value set for a given lighting component.
component | The lighting component. |
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.
|
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 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.
values | A vector holding the light attenuation and maximum distance parameters. |
|
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.
constant | The constant light attenuation value. |
linear | The linear light attenuation value. |
quadratic | The quadratic light attenuation value. |
maxDistance | The maximum distance 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. |
Set the light's maximum influence radius.
value | The radius of the bounding sphere. |
|
pure virtual |
Get the light attenuation parameters and maximum distance.
|
pure virtual |
Get the constant light attenuation parameter.
|
pure virtual |
Get the linear light attenuation parameter.
|
pure virtual |
Get the quadratic light attenuation parameter.
|
pure virtual |
Get the light's maximum influence radius.
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 current world transform.
transform | The current world transform. |
Set the light's projection matrix.
projection | The projection matrix. |
|
pure virtual |
Set the light's shadow view/projection matrix for a given cascade.
viewProjection | The view/projection matrix. |
cascadeIndex | The cascade index, in the range [0..3] |
|
pure virtual |
Get the current light position in world space.
|
pure virtual |
Get the current light direction in world space.
|
pure virtual |
Get the light's current world transform.
|
pure virtual |
Get the light's projection matrix.
|
pure virtual |
Get the light's current view matrix.
This equals the inverse of the current world transform.
|
pure virtual |
Get the light's combined current view and projection matrix.
|
pure virtual |
Get the light's combined current shadow view and projection matrix for a given cascade.
cascadeIndex | The cascade index, in the range [0..3] |
Calculate the screen area affected by the light with respect to a camera.
camera | The camera. |