Class SpotLight
Spot light emits light from the point in a given direction.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Level/Actors/SpotLight.h
Syntax
public class SpotLight : public LightWithShadow
Fields
FallOffExponent
Controls the radial falloff of light when UseInverseSquaredFalloff is disabled.
Declaration
public float FallOffExponent = 8.0f
Field Value
|
float
|
IESBrightnessScale
Global scale for IES brightness contribution.
Declaration
public float IESBrightnessScale = 1.0f
Field Value
|
float
|
IESTexture
IES texture (light profiles from real world measured data).
Declaration
public AssetReference<IESProfile> IESTexture
Field Value
|
AssetReference<IESProfile>
|
SourceRadius
Light source bulb radius.
Declaration
public float SourceRadius = 0.0f
Field Value
|
float
|
UseIESBrightness
Enable/disable using light brightness from IES profile.
Declaration
public bool UseIESBrightness = false
Field Value
|
bool
|
UseInverseSquaredFalloff
Whether to use physically based inverse squared distance falloff, where Radius is only clamping the light's contribution.
Declaration
public bool UseInverseSquaredFalloff = false
Field Value
|
bool
|
Methods
ComputeBrightness()
Computes light brightness value.
Declaration
public float ComputeBrightness() const
Returns
|
float
|
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
|
DeserializeStream
stream
The input stream. |
|
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
Draw(RenderContext& renderContext)
Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass).
Declaration
public virtual void Draw(RenderContext& renderContext) override
Parameters
|
RenderContext
renderContext
The rendering context. |
Overrides
DrawLightsDebug(RenderView& view)
Declaration
public virtual void DrawLightsDebug(RenderView& view) override
Parameters
|
RenderView
view
|
Overrides
GetInnerConeAngle()
Sets the spot light's inner cone angle (in degrees).
Declaration
public float GetInnerConeAngle() const
Returns
|
float
|
GetOuterConeAngle()
Gets the spot light's outer cone angle (in degrees).
Declaration
public float GetOuterConeAngle() const
Returns
|
float
|
GetRadius()
Gets light radius.
Declaration
public float GetRadius() const
Returns
|
float
|
GetScaledRadius()
Gets scaled light radius.
Declaration
public float GetScaledRadius() const
Returns
|
float
|
IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
Determines if there is an intersection between the current object and a ray.
Declaration
public virtual bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override
Parameters
|
Ray
ray
The ray to test. |
|
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
|
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Returns
|
bool
True whether the two objects intersected, otherwise false. |
Overrides
OnDebugDraw()
Draws debug shapes for the actor and all child scripts.
Declaration
public virtual void OnDebugDraw() override
Overrides
OnDebugDrawSelected()
Draws debug shapes for the selected actor and all child scripts.
Declaration
public virtual void OnDebugDrawSelected() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
|
SerializeStream
stream
The output stream. |
|
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetInnerConeAngle(float value)
Sets the spot light's inner cone angle (in degrees).
Declaration
public void SetInnerConeAngle(float value)
Parameters
|
float
value
|
SetOuterConeAngle(float value)
Sets the spot light's outer cone angle (in degrees).
Declaration
public void SetOuterConeAngle(float value)
Parameters
|
float
value
|
SetRadius(float value)
Sets light radius.
Declaration
public void SetRadius(float value)
Parameters
|
float
value
|