Open 3D Engine AtomLyIntegration Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Render::DirectionalLightRequests Class Referenceabstract

Inherits AZ::ComponentBus.

Public Member Functions

virtual const Color & GetColor () const =0
 
virtual void SetColor (const Color &color)=0
 
virtual float GetIntensity () const =0
 
virtual void SetIntensity (float intensity, PhotometricUnit unit)=0
 
virtual void SetIntensity (float intensity)=0
 
virtual float GetAngularDiameter () const =0
 
virtual void SetAngularDiameter (float angularDiameter)=0
 
virtual ShadowmapSize GetShadowmapSize () const =0
 
virtual void SetShadowmapSize (ShadowmapSize size)=0
 This specifies the size of shadowmaps (for each cascade) to size x size.
 
virtual uint32_t GetCascadeCount () const =0
 
virtual void SetCascadeCount (uint32_t cascadeCount)=0
 
virtual float GetShadowmapFrustumSplitSchemeRatio () const =0
 
virtual void SetShadowmapFrustumSplitSchemeRatio (float ratio)=0
 
virtual const Vector4 & GetCascadeFarDepth ()=0
 
virtual void SetCascadeFarDepth (const Vector4 &farDepth)=0
 
virtual bool GetShadowmapFrustumSplitAutomatic () const =0
 
virtual void SetShadowmapFrustumSplitAutomatic (bool isAutomatic)=0
 
virtual EntityId GetCameraEntityId () const =0
 
virtual void SetCameraEntityId (EntityId entityId)=0
 
virtual float GetShadowFarClipDistance () const =0
 
virtual void SetShadowFarClipDistance (float farDist)=0
 
virtual float GetGroundHeight () const =0
 
virtual void SetGroundHeight (float groundHeight)=0
 
virtual bool GetViewFrustumCorrectionEnabled () const =0
 
virtual void SetViewFrustumCorrectionEnabled (bool enabled)=0
 
virtual bool GetDebugColoringEnabled () const =0
 
virtual void SetDebugColoringEnabled (bool enabled)=0
 
virtual ShadowFilterMethod GetShadowFilterMethod () const =0
 
virtual void SetShadowFilterMethod (ShadowFilterMethod method)=0
 
virtual uint32_t GetFilteringSampleCount () const =0
 
virtual void SetFilteringSampleCount (uint32_t count)=0
 
virtual bool GetShadowReceiverPlaneBiasEnabled () const =0
 
virtual void SetShadowReceiverPlaneBiasEnabled (bool enable)=0
 
virtual float GetShadowBias () const =0
 
virtual void SetShadowBias (float bias)=0
 
virtual float GetNormalShadowBias () const =0
 
virtual void SetNormalShadowBias (float normalShadowBias)=0
 
virtual bool GetCascadeBlendingEnabled () const =0
 
virtual void SetCascadeBlendingEnabled (bool enable)=0
 
virtual bool GetAffectsGI () const =0
 Returns true if this light affects global illumination.
 
virtual void SetAffectsGI (bool affectsGI)=0
 Set whether this light affects global illumination.
 
virtual float GetAffectsGIFactor () const =0
 Returns the contribution multiplier for global illumination.
 
virtual void SetAffectsGIFactor (float affectsGIFactor)=0
 Sets the contribution multiplier for global illumination.
 
virtual void BindConfigurationChangedEventHandler (DirectionalLightConfigurationChangedEvent::Handler &configurationChangedHandler)=0
 

Member Function Documentation

◆ BindConfigurationChangedEventHandler()

virtual void AZ::Render::DirectionalLightRequests::BindConfigurationChangedEventHandler ( DirectionalLightConfigurationChangedEvent::Handler &  configurationChangedHandler)
pure virtual

Bind to this event to be notified whenever at least one of the configuration properties of the Directional Light Component changes. REMARK: This event won't be signaled when the Set*() functions are called on a particular directional light, instead, this event will be signaled only when the user modifies the component properties in the Inspector panel.

◆ GetAngularDiameter()

virtual float AZ::Render::DirectionalLightRequests::GetAngularDiameter ( ) const
pure virtual

Gets a directional light's angular diameter.

Returns
directional light's angular diameter in degrees.

◆ GetCameraEntityId()

virtual EntityId AZ::Render::DirectionalLightRequests::GetCameraEntityId ( ) const
pure virtual

This gets the entity ID of the camera used for specifying view frustum to create shadowmaps.

Returns
camera entity ID.

◆ GetCascadeBlendingEnabled()

virtual bool AZ::Render::DirectionalLightRequests::GetCascadeBlendingEnabled ( ) const
pure virtual

Gets whether the directional shadow map has cascade blending enabled. This smooths out the border between cascades at the cost of some performance in the blend area.

◆ GetCascadeCount()

virtual uint32_t AZ::Render::DirectionalLightRequests::GetCascadeCount ( ) const
pure virtual

This gets cascade count of the shadowmap.

Returns
cascade count

◆ GetCascadeFarDepth()

virtual const Vector4 & AZ::Render::DirectionalLightRequests::GetCascadeFarDepth ( )
pure virtual

This gets the far depth of the cascade.

Returns
the far depth for each cascade.

◆ GetColor()

virtual const Color & AZ::Render::DirectionalLightRequests::GetColor ( ) const
pure virtual

Gets a directional light's color. This value is independent from its intensity.

Returns
directional light's color

◆ GetDebugColoringEnabled()

virtual bool AZ::Render::DirectionalLightRequests::GetDebugColoringEnabled ( ) const
pure virtual

This gets the flag whether debug coloring is enabled or not. By debug coloring, we can see how cascading of shadowmaps works.

Returns
the flag whether debug coloring is enabled or not.

◆ GetFilteringSampleCount()

virtual uint32_t AZ::Render::DirectionalLightRequests::GetFilteringSampleCount ( ) const
pure virtual

This gets the sample count for filtering of the shadow boundary.

Returns
Sample Count for filtering (up to 64)

◆ GetGroundHeight()

virtual float AZ::Render::DirectionalLightRequests::GetGroundHeight ( ) const
pure virtual

This gets the height of the ground. The position of view frustum is corrected using ground height to get better quality of shadow around the area close to the camera. To enable the correction, SetViewFrustumCorrectionEnabled(true) is required.

Returns
ground height

◆ GetIntensity()

virtual float AZ::Render::DirectionalLightRequests::GetIntensity ( ) const
pure virtual

Gets a directional light's intensity. This value is independent from its color.

Returns
directional light's intensity

◆ GetNormalShadowBias()

virtual float AZ::Render::DirectionalLightRequests::GetNormalShadowBias ( ) const
pure virtual

Reduces acne by biasing the shadowmap lookup along the geometric normal.

Returns
Returns the amount of bias to apply.

◆ GetShadowBias()

virtual float AZ::Render::DirectionalLightRequests::GetShadowBias ( ) const
pure virtual

Shadow bias reduces acne by applying a small amount of offset along shadow-space z.

Returns
Returns the amount of bias to apply.

◆ GetShadowFarClipDistance()

virtual float AZ::Render::DirectionalLightRequests::GetShadowFarClipDistance ( ) const
pure virtual

This gets shadow specific far clip distance. Pixels further than this value won't have shadows Smaller values result in higher quality shadows

Returns
far clip distance

◆ GetShadowFilterMethod()

virtual ShadowFilterMethod AZ::Render::DirectionalLightRequests::GetShadowFilterMethod ( ) const
pure virtual

This gets the filter method of shadows.

Returns
filter method

◆ GetShadowmapFrustumSplitAutomatic()

virtual bool AZ::Render::DirectionalLightRequests::GetShadowmapFrustumSplitAutomatic ( ) const
pure virtual

This gets the flag split of shadowmap frustum is automatic.

Returns
it is automatic if true, and it is manual if false.

◆ GetShadowmapFrustumSplitSchemeRatio()

virtual float AZ::Render::DirectionalLightRequests::GetShadowmapFrustumSplitSchemeRatio ( ) const
pure virtual

This gets ratio between logarithm/uniform scheme to split view frustum.

Returns
the ratio (in [0,1]) between uniform scheme and logarithm scheme for splitting the view frustum into cascades. ratio==0 means uniform and ratio==1 means logarithm. uniform: the most detailed cascade covers wider area but less detailed. logarithm: the most detailed cascade covers narrower area but more detailed. The least detailed cascade is not affected by this parameter.

◆ GetShadowmapSize()

virtual ShadowmapSize AZ::Render::DirectionalLightRequests::GetShadowmapSize ( ) const
pure virtual

This gets shadowmap size (width/height).

Returns
shadowmap size.

◆ GetShadowReceiverPlaneBiasEnabled()

virtual bool AZ::Render::DirectionalLightRequests::GetShadowReceiverPlaneBiasEnabled ( ) const
pure virtual

Gets whether the directional shadowmap should use receiver plane bias. This attempts to reduce shadow acne when using large pcf filters.

◆ GetViewFrustumCorrectionEnabled()

virtual bool AZ::Render::DirectionalLightRequests::GetViewFrustumCorrectionEnabled ( ) const
pure virtual

This gets the flag whether view frustum correction is enabled not not. The calculation of it is caused when position or configuration of the camera is changed.

Returns
flag of view frustum correction is enbled or not

◆ SetAngularDiameter()

virtual void AZ::Render::DirectionalLightRequests::SetAngularDiameter ( float  angularDiameter)
pure virtual

Sets a directional light's angular diameter. This value should be small, for instance the sun is 0.5 degrees across.

Parameters
angularDiameterDirectional light's angular diameter in degrees.

◆ SetCameraEntityId()

virtual void AZ::Render::DirectionalLightRequests::SetCameraEntityId ( EntityId  entityId)
pure virtual

This sets the entity ID of the camera used for specifying view frustum to create shadowmaps.

Parameters
entityIdcamera entity ID.

◆ SetCascadeBlendingEnabled()

virtual void AZ::Render::DirectionalLightRequests::SetCascadeBlendingEnabled ( bool  enable)
pure virtual

Sets whether the directional shadow map has cascade blending enabled.

Parameters
enableflag specifying whether to enable cascade blending.

◆ SetCascadeCount()

virtual void AZ::Render::DirectionalLightRequests::SetCascadeCount ( uint32_t  cascadeCount)
pure virtual

This sets cascade count of the shadowmap

Parameters
cascadeCountcascade count

◆ SetCascadeFarDepth()

virtual void AZ::Render::DirectionalLightRequests::SetCascadeFarDepth ( const Vector4 &  farDepth)
pure virtual

This sets the far depth of the cascade. If this is called, the ratio of frustum split scheme will be ignored.

Parameters
farDepththe far depth to be set.

◆ SetColor()

virtual void AZ::Render::DirectionalLightRequests::SetColor ( const Color &  color)
pure virtual

Sets a directional light's color. This value is independent from its intensity.

Parameters
colordirectional light's color

◆ SetDebugColoringEnabled()

virtual void AZ::Render::DirectionalLightRequests::SetDebugColoringEnabled ( bool  enabled)
pure virtual

This specifies whether debug coloring is enabled or not.

Parameters
enabledflag specifying whether debug coloring is added.

◆ SetFilteringSampleCount()

virtual void AZ::Render::DirectionalLightRequests::SetFilteringSampleCount ( uint32_t  count)
pure virtual

This sets the sample count for filtering of the shadow boundary.

Parameters
countSample Count for filtering (up to 64)

◆ SetGroundHeight()

virtual void AZ::Render::DirectionalLightRequests::SetGroundHeight ( float  groundHeight)
pure virtual

This specifies the height of the ground.

Parameters
groundHeightheight of the ground

◆ SetIntensity() [1/2]

virtual void AZ::Render::DirectionalLightRequests::SetIntensity ( float  intensity)
pure virtual

Sets a directional light's intensity. This value is independent from its color. Assumes no change in the current photometric unit of the intensity.

Parameters
intensitydirectional light's intensity

◆ SetIntensity() [2/2]

virtual void AZ::Render::DirectionalLightRequests::SetIntensity ( float  intensity,
PhotometricUnit  unit 
)
pure virtual

Sets a directional light's intensity. This value is independent from its color.

Parameters
intensitydirectional light's intensity
typeThe photometric unit of the intensity.

◆ SetNormalShadowBias()

virtual void AZ::Render::DirectionalLightRequests::SetNormalShadowBias ( float  normalShadowBias)
pure virtual

Reduces acne by biasing the shadowmap lookup along the geometric normal.

Parameters
normalShadowBiasSets the amount of normal shadow bias to apply.

◆ SetShadowBias()

virtual void AZ::Render::DirectionalLightRequests::SetShadowBias ( float  bias)
pure virtual

Shadow bias reduces acne by applying a small amount of offset along shadow-space z.

Parameters
Setsthe amount of bias to apply.

◆ SetShadowFarClipDistance()

virtual void AZ::Render::DirectionalLightRequests::SetShadowFarClipDistance ( float  farDist)
pure virtual

This sets shadow specific far clip distance.

Parameters
farDistthe far clip distance for each cascade.

◆ SetShadowFilterMethod()

virtual void AZ::Render::DirectionalLightRequests::SetShadowFilterMethod ( ShadowFilterMethod  method)
pure virtual

This specifies filter method of shadows.

Parameters
methodfilter method.

◆ SetShadowmapFrustumSplitAutomatic()

virtual void AZ::Render::DirectionalLightRequests::SetShadowmapFrustumSplitAutomatic ( bool  isAutomatic)
pure virtual

This sets the flag split of shadowmap frustum is automatic.

Parameters
isAutomaticthe flag to be set.

◆ SetShadowmapFrustumSplitSchemeRatio()

virtual void AZ::Render::DirectionalLightRequests::SetShadowmapFrustumSplitSchemeRatio ( float  ratio)
pure virtual

This sets ratio between logarithm/uniform scheme to split view frustum. If this is called, frustum splitting becomes automatic and the far depths given by SetCascadeFarDepth() is discarded.

Parameters
ratiothe ratio (in [0,1])

◆ SetShadowReceiverPlaneBiasEnabled()

virtual void AZ::Render::DirectionalLightRequests::SetShadowReceiverPlaneBiasEnabled ( bool  enable)
pure virtual

Sets whether the directional shadowmap should use receiver plane bias.

Parameters
enableflag specifying whether to enable the receiver plane bias feature

◆ SetViewFrustumCorrectionEnabled()

virtual void AZ::Render::DirectionalLightRequests::SetViewFrustumCorrectionEnabled ( bool  enabled)
pure virtual

This specifies whether view frustum correction is enabled or not.

Parameters
enabledflag specifying whether view frustum positions are corrected.

The documentation for this class was generated from the following file: