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::DirectionalLightComponentConfig Struct Referencefinal

Inherits AZ::ComponentConfig.

Public Member Functions

 AZ_RTTI (DirectionalLightComponentConfig, "EB01B835-F9FE-4FF0-BDC4-455462BFE769", ComponentConfig)
 
const char * GetIntensitySuffix () const
 Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
 
float GetIntensityMin () const
 Returns the minimum intensity value allowed depending on the m_intensityMode.
 
float GetIntensityMax () const
 Returns the maximum intensity value allowed depending on the m_intensityMode.
 
float GetIntensitySoftMin () const
 Returns the minimum intensity value for UI depending on the m_intensityMode, but users may still type in a lesser value depending on GetIntensityMin().
 
float GetIntensitySoftMax () const
 Returns the maximum intensity value for UI depending on the m_intensityMode, but users may still type in a greater value depending on GetIntensityMin().
 
bool IsSplitManual () const
 
bool IsSplitAutomatic () const
 
bool IsCascadeCorrectionDisabled () const
 
bool IsShadowFilteringDisabled () const
 
bool IsShadowPcfDisabled () const
 
bool IsEsmDisabled () const
 
AZ::Crc32 UpdateCascadeFarDepths ()
 

Static Public Member Functions

static void Reflect (ReflectContext *context)
 

Public Attributes

AZ::Color m_color = AZ::Color::CreateOne()
 
PhotometricUnit m_intensityMode = PhotometricUnit::Ev100Illuminance
 Lux or Ev100.
 
float m_intensity = 4.0f
 Intensity in lux or Ev100 (depending on m_intensityMode)
 
float m_angularDiameter = 0.5f
 Angular diameter of light in degrees, should be small. The sun is about 0.5.
 
EntityId m_cameraEntityId { EntityId::InvalidEntityId }
 EntityId of the camera specifying view frustum to create shadowmaps.
 
float m_shadowFarClipDistance = 100.f
 Far depth clips for shadows.
 
ShadowmapSize m_shadowmapSize = ShadowmapSize::Size1024
 Width/Height of shadowmap images.
 
uint32_t m_cascadeCount = 4
 Number of cascades.
 
bool m_isShadowmapFrustumSplitAutomatic = true
 
float m_shadowmapFrustumSplitSchemeRatio = 0.9f
 
AZ::Vector4 m_cascadeFarDepths
 
float m_groundHeight = 0.f
 
bool m_isCascadeCorrectionEnabled = false
 
bool m_isDebugColoringEnabled = false
 Flag specifying whether debug coloring is added.
 
ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None
 Method of shadow's filtering.
 
float m_normalShadowBias = 2.5f
 
uint16_t m_filteringSampleCount = 32
 
bool m_receiverPlaneBiasEnabled = true
 
float m_shadowBias = 0.0015f
 Reduces shadow acne by applying a small amount of offset along shadow-space z.
 
bool m_cascadeBlendingEnabled = false
 
bool m_fullscreenBlurEnabled = true
 
float m_fullscreenBlurConstFalloff = 2.0f / 3.0f
 How much a value is reduced from pixel to pixel on a perfectly flat surface.
 
float m_fullscreenBlurDepthFalloffStrength = 50.0f
 
bool m_affectsGI = true
 
float m_affectsGIFactor = 1.0f
 

Member Data Documentation

◆ m_cascadeFarDepths

AZ::Vector4 AZ::Render::DirectionalLightComponentConfig::m_cascadeFarDepths
Initial value:
{
m_shadowFarClipDistance * 1 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 2 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 3 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 4 / Shadow::MaxNumberOfCascades
}
float m_shadowFarClipDistance
Far depth clips for shadows.
Definition: DirectionalLightComponentConfig.h:63

Far depth for each cascade. Note that near depth of a cascade equals the far depth of the previous cascade. This is valid only when m_shadowmapFrustumSplitIsAutomatic = false.

◆ m_filteringSampleCount

uint16_t AZ::Render::DirectionalLightComponentConfig::m_filteringSampleCount = 32

Sample Count for filtering (from 4 to 64) It is used only when the pixel is predicted as on the boundary.

◆ m_fullscreenBlurDepthFalloffStrength

float AZ::Render::DirectionalLightComponentConfig::m_fullscreenBlurDepthFalloffStrength = 50.0f

How much the difference in depth slopes between pixels affects the blur falloff. The higher this value, the sharper edges will appear

◆ m_groundHeight

float AZ::Render::DirectionalLightComponentConfig::m_groundHeight = 0.f

Height of camera from the ground. The position of view frustum is corrected using cameraHeight to get better quality of shadow around the area close to the camera. To enable the correction, m_isCascadeCorrectionEnabled=true is required.

◆ m_isCascadeCorrectionEnabled

bool AZ::Render::DirectionalLightComponentConfig::m_isCascadeCorrectionEnabled = false

Flag specifying whether view frustum positions are corrected. The calculation of it is caused when the position of configuration of the camera is changed.

◆ m_isShadowmapFrustumSplitAutomatic

bool AZ::Render::DirectionalLightComponentConfig::m_isShadowmapFrustumSplitAutomatic = true

Flag to switch splitting of shadowmap frustum to cascades automatically or not. If true, m_shadowmapFrustumSplitSchemeRatio is used. If false, m_cascadeFarDepths is used.

◆ m_receiverPlaneBiasEnabled

bool AZ::Render::DirectionalLightComponentConfig::m_receiverPlaneBiasEnabled = true

Whether not to enable the receiver plane bias. This uses partial derivatives to reduce shadow acne when using large pcf kernels.

◆ m_shadowmapFrustumSplitSchemeRatio

float AZ::Render::DirectionalLightComponentConfig::m_shadowmapFrustumSplitSchemeRatio = 0.9f

Ratio to lerp between the two types of frustum splitting scheme. 0 = Uniform scheme which will split the Frustum evenly across all cascades. 1 = Logarithmic scheme which is designed to split the frustum in a logarithmic fashion in order to enable us to produce a more optimal perspective aliasing across the frustum. This is valid only when m_shadowmapFrustumSplitIsAutomatic = true.


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