Class DirectionalLight
This class represents all properties of sunlight.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class DirectionalLight : Light, IDependencyObject
Constructors
DirectionalLight()
Initializes a new instance of the DirectionalLight class.
Declaration
public DirectionalLight()
Fields
SplitDistance
Manually defined cascade split partition values.
Declaration
public float[] SplitDistance
Field Value
Type | Description |
---|---|
float[] |
Properties
CascadeCount
Gets the number of cascades associated with this light.
Declaration
public override int CascadeCount { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
DebugMode
Gets or sets a value indicating whether to show the cascade for directional lights.
Declaration
[RenderProperty(AttachToTag = 3, AttachToValue = true, CustomPropertyName = "Debug Mode")]
public bool DebugMode { get; set; }
Property Value
Type | Description |
---|---|
bool |
Direction
Gets the direction.
Declaration
public Vector3 Direction { get; }
Property Value
Type | Description |
---|---|
Vector3 | The direction. |
GammaDistribution
Gets or sets the gamma distribution value used for logarithmic partitioning mode.
Declaration
[RenderProperty(AttachToTag = 3, AttachToValue = true)]
public float GammaDistribution { get; set; }
Property Value
Type | Description |
---|---|
float |
IsShadowEnabled
Gets or sets a value indicating whether shadows are enabled.
Declaration
[RenderProperty(Tag = 3, CustomPropertyName = "Shadow enabled")]
public override bool IsShadowEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Overrides
LightType
Gets the type of light.
Declaration
public override LightType LightType { get; }
Property Value
Type | Description |
---|---|
LightType |
Overrides
ShadowBias
Gets or sets the shadow's depth bias.
Declaration
[RenderProperty(AttachToTag = 3, AttachToValue = true)]
public override float ShadowBias { get; set; }
Property Value
Type | Description |
---|---|
float |
Overrides
ShadowDistance
Gets or sets the maximum distance from the camera at which shadows are rendered.
Declaration
[RenderProperty(AttachToTag = 3, AttachToValue = true)]
public float ShadowDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
ComputeBoundingBox(out BoundingBox)
Computes the bounding box of the light.
Declaration
public override void ComputeBoundingBox(out BoundingBox boundingBox)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | boundingBox | The bounding box. |
Overrides
Intersects(ref BoundingBox)
Checks if the current light intersects with the specified bbox.
Declaration
public override bool Intersects(ref BoundingBox frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | frustum |
Returns
Type | Description |
---|---|
bool | Whether the light is inside the frustum view. |
Overrides
Intersects(ref BoundingFrustum)
Checks if the current light is inside the specified frustum.
Declaration
public override bool Intersects(ref BoundingFrustum frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | frustum | The frustum. |
Returns
Type | Description |
---|---|
bool | Whether the light is inside the frustum view. |