Open 3D Engine Atom 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::DirectionalLightFeatureProcessorInterface Class Referenceabstract

#include <DirectionalLightFeatureProcessorInterface.h>

Inherits AZ::RPI::FeatureProcessor.

Inherited by AZ::Render::DirectionalLightFeatureProcessor.

Public Types

enum  DebugDrawFlags : uint32_t { DebugDrawNone = 0b000 , DebugDrawColoring = 0b001 , DebugDrawBoundingBoxes = 0b010 , DebugDrawAll = ~DebugDrawNone }
 
using LightHandle = RHI::Handle< uint16_t, class DirectionalLight >
 

Public Member Functions

 AZ_RTTI (AZ::Render::DirectionalLightFeatureProcessorInterface, "82C274F8-C635-4725-9ECB-0D7FA0DC0C6C", AZ::RPI::FeatureProcessor)
 
virtual LightHandle AcquireLight ()=0
 
virtual bool ReleaseLight (LightHandle &lightHandle)=0
 
virtual LightHandle CloneLight (LightHandle lightHandle)=0
 
virtual void SetRgbIntensity (LightHandle handle, const PhotometricColor< PhotometricUnit::Lux > &lightColor)=0
 
virtual void SetDirection (LightHandle handle, const Vector3 &direction)=0
 
virtual void SetAngularDiameter (LightHandle handle, float angularDiameter)=0
 
virtual void SetShadowmapSize (LightHandle handle, ShadowmapSize size)=0
 
virtual void SetCascadeCount (LightHandle handle, uint16_t cascadeCount)=0
 
virtual void SetShadowmapFrustumSplitSchemeRatio (LightHandle handle, float ratio)=0
 
virtual void SetCascadeFarDepth (LightHandle handle, uint16_t cascadeIndex, float farDepth)=0
 
virtual void SetCameraConfiguration (LightHandle handle, const Camera::Configuration &cameraConfiguration, const RPI::RenderPipelineId &renderPipelineId=RPI::RenderPipelineId())=0
 
virtual void SetShadowFarClipDistance (LightHandle handle, float farDist)=0
 
virtual void SetCameraTransform (LightHandle handle, const Transform &cameraTransform, const RPI::RenderPipelineId &renderPipelineId=RPI::RenderPipelineId())=0
 
virtual void SetGroundHeight (LightHandle handle, float groundHeight)=0
 
virtual void SetViewFrustumCorrectionEnabled (LightHandle, bool enabled)=0
 
virtual void SetDebugFlags (LightHandle handle, DebugDrawFlags flags)=0
 
virtual void SetShadowFilterMethod (LightHandle handle, ShadowFilterMethod method)=0
 
virtual void SetFilteringSampleCount (LightHandle handle, uint16_t count)=0
 
virtual void SetShadowReceiverPlaneBiasEnabled (LightHandle handle, bool enable)=0
 
virtual void SetShadowBias (LightHandle handle, float bias)=0
 Reduces acne by applying a small amount of bias along shadow-space z.
 
virtual void SetNormalShadowBias (LightHandle handle, float normalShadowBias)=0
 Reduces acne by biasing the shadowmap lookup along the geometric normal.
 
virtual void SetCascadeBlendingEnabled (LightHandle handle, bool enable)=0
 Sets whether or not blending between shadow map cascades is enabled.
 
virtual void SetFullscreenBlurEnabled (LightHandle handle, bool enable)=0
 Sets whether or not to apply fullscreen blur after fullscreen shadow pass.
 
virtual void SetFullscreenBlurConstFalloff (LightHandle handle, float blurConstFalloff)=0
 Sets the amount of constant falloff on the fullscreen shadow blur.
 
virtual void SetFullscreenBlurDepthFalloffStrength (LightHandle handle, float blurDepthFalloffStrength)=0
 Sets the strength of the depth falloff on the fullscreen shadow blur.
 
virtual void SetAffectsGI (LightHandle handle, bool affectsGI)=0
 Specifies if this light affects the diffuse global illumination in the scene.
 
virtual void SetAffectsGIFactor (LightHandle handle, float affectsGIFactor)=0
 Specifies the contribution of this light to the diffuse global illumination in the scene.
 
- Public Member Functions inherited from AZ::RPI::FeatureProcessor
 AZ_RTTI (FeatureProcessor, "{B8027170-C65C-4237-964D-B557FC9D7575}")
 
 AZ_CLASS_ALLOCATOR (FeatureProcessor, AZ::SystemAllocator)
 
SceneGetParentScene () const
 
virtual void Activate ()
 Perform any necessary activation and gives access to owning Scene.
 
virtual void Deactivate ()
 Perform any necessary deactivation.
 
virtual void ApplyRenderPipelineChange (RenderPipeline *pipeline)
 
virtual void AddRenderPasses (RenderPipeline *pipeline)
 
virtual void PrepareViews (const PrepareViewsPacket &, AZStd::vector< AZStd::pair< PipelineViewTag, ViewPtr > > &)
 
virtual void Simulate (const SimulatePacket &)
 
virtual void Render (const RenderPacket &)
 
virtual void OnEndCulling (const RenderPacket &)
 
virtual void OnRenderEnd ()
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::RPI::FeatureProcessor
void EnableSceneNotification ()
 
void DisableSceneNotification ()
 

Detailed Description

DirectionalLightFeatureProcessorInterface provides an interface to acquire, release, and update a directional light. This is necessary for code outside of the Atom features gem to communicate with the DirectionalLightFeatureProcessor.

Member Function Documentation

◆ AcquireLight()

virtual LightHandle AZ::Render::DirectionalLightFeatureProcessorInterface::AcquireLight ( )
pure virtual

This creates a new directional light which can be referenced by the returned LightHandle. This must be released via ReleaseLight() when no longer needed.

Returns
the handle of the new directional light.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ CloneLight()

virtual LightHandle AZ::Render::DirectionalLightFeatureProcessorInterface::CloneLight ( LightHandle  lightHandle)
pure virtual

This creates a new LightHandle by copying data from an existing LightHandle.

Parameters
lightHandlethe handle to clone.
Returns
the handle of the new cloned light.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ ReleaseLight()

virtual bool AZ::Render::DirectionalLightFeatureProcessorInterface::ReleaseLight ( LightHandle lightHandle)
pure virtual

This releases a LightHandle which removes the directional light.

Parameters
lightHandlethe handle to release.
Returns
true if it is released.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetAffectsGI()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetAffectsGI ( LightHandle  handle,
bool  affectsGI 
)
pure virtual

Specifies if this light affects the diffuse global illumination in the scene.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetAffectsGIFactor()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetAffectsGIFactor ( LightHandle  handle,
float  affectsGIFactor 
)
pure virtual

Specifies the contribution of this light to the diffuse global illumination in the scene.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetAngularDiameter()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetAngularDiameter ( LightHandle  handle,
float  angularDiameter 
)
pure virtual

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

Parameters
handlethe light handle.
angularDiameterDirectional light's angular diameter in degrees.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetCameraConfiguration()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetCameraConfiguration ( LightHandle  handle,
const Camera::Configuration &  cameraConfiguration,
const RPI::RenderPipelineId &  renderPipelineId = RPI::RenderPipelineId() 
)
pure virtual

This sets camera configuration which affect to cascade segmentation.

Parameters
handlethe light handle.
cameraConfigurationthe camera configuration.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetCameraTransform()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetCameraTransform ( LightHandle  handle,
const Transform &  cameraTransform,
const RPI::RenderPipelineId &  renderPipelineId = RPI::RenderPipelineId() 
)
pure virtual

This sets camera transform which affect to cascade segmentation.

Parameters
handlethe light handle.
Returns
cameraTransform the camera transform.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetCascadeBlendingEnabled()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetCascadeBlendingEnabled ( LightHandle  handle,
bool  enable 
)
pure virtual

Sets whether or not blending between shadow map cascades is enabled.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetCascadeCount()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetCascadeCount ( LightHandle  handle,
uint16_t  cascadeCount 
)
pure virtual

This sets cascade count of the shadowmap.

Parameters
handlethe light handle.
cascadeCountthe count of cascade (from 1 to 4).

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetCascadeFarDepth()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetCascadeFarDepth ( LightHandle  handle,
uint16_t  cascadeIndex,
float  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
handlethe light handle.
cascadeIndexthe index of the cascade to be changed.
farDepththe far depth to be set.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetDebugFlags()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetDebugFlags ( LightHandle  handle,
DebugDrawFlags  flags 
)
pure virtual

This specifies what debug features to display.

Parameters
handlethe light handle.
flagsflags specifying the debug features. See DebugDrawFlags for more info. By drawing debug colors and bounding boxes, we can see how cascading of shadowmaps works.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetDirection()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetDirection ( LightHandle  handle,
const Vector3 &  direction 
)
pure virtual

This sets the direction of the light. direction should be normalized.

Parameters
handlethe light handle.
Returns
direction the direction of the light.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetFilteringSampleCount()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetFilteringSampleCount ( LightHandle  handle,
uint16_t  count 
)
pure virtual

This sets sample count for filtering of shadow boundary.

Parameters
handlethe light handle.
countSample Count for filtering (up to 64)

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetFullscreenBlurConstFalloff()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetFullscreenBlurConstFalloff ( LightHandle  handle,
float  blurConstFalloff 
)
pure virtual

Sets the amount of constant falloff on the fullscreen shadow blur.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetFullscreenBlurDepthFalloffStrength()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetFullscreenBlurDepthFalloffStrength ( LightHandle  handle,
float  blurDepthFalloffStrength 
)
pure virtual

Sets the strength of the depth falloff on the fullscreen shadow blur.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetFullscreenBlurEnabled()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetFullscreenBlurEnabled ( LightHandle  handle,
bool  enable 
)
pure virtual

Sets whether or not to apply fullscreen blur after fullscreen shadow pass.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetGroundHeight()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetGroundHeight ( LightHandle  handle,
float  groundHeight 
)
pure virtual

This specifies the height of the ground.

Parameters
handlethe light handle.
groundHeightheight of the ground. The position of view frustum is corrected using groundHeight to get better quality of shadow around the area close to the camera. To enable the correction, SetViewFrustumCorrectionEnabled(true) is required.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetNormalShadowBias()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetNormalShadowBias ( LightHandle  handle,
float  normalShadowBias 
)
pure virtual

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

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetRgbIntensity()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetRgbIntensity ( LightHandle  handle,
const PhotometricColor< PhotometricUnit::Lux > &  lightColor 
)
pure virtual

This sets the intensity in RGB lux for a given LightHandle.

Parameters
handlethe light handle.
lightColorthe intensity in RGB lux.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowBias()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowBias ( LightHandle  handle,
float  bias 
)
pure virtual

Reduces acne by applying a small amount of bias along shadow-space z.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowFarClipDistance()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowFarClipDistance ( LightHandle  handle,
float  farDist 
)
pure virtual

This sets shadow specific far clip depth. Pixels beyond the far clip depth do not receive shadows. Reducing this value improves shadow quality.

Parameters
handlethe light handle.
farDistthe far clip depth.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowFilterMethod()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowFilterMethod ( LightHandle  handle,
ShadowFilterMethod  method 
)
pure virtual

This specifies filter method of shadows.

Parameters
handlethe light handle.
methodfilter method.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowmapFrustumSplitSchemeRatio()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowmapFrustumSplitSchemeRatio ( LightHandle  handle,
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() are discarded.

Parameters
handlethe light handle.
ratiothe ratio (in [0,1]) between logarithm scheme and uniform scheme to split view frustum into segments. 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.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowmapSize()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowmapSize ( LightHandle  handle,
ShadowmapSize  size 
)
pure virtual

This sets the shadowmap size (width and height) of the light.

Parameters
handlethe light handle.
sizethe shadowmap size (width/height).

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetShadowReceiverPlaneBiasEnabled()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetShadowReceiverPlaneBiasEnabled ( LightHandle  handle,
bool  enable 
)
pure virtual

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

Implemented in AZ::Render::DirectionalLightFeatureProcessor.

◆ SetViewFrustumCorrectionEnabled()

virtual void AZ::Render::DirectionalLightFeatureProcessorInterface::SetViewFrustumCorrectionEnabled ( LightHandle  ,
bool  enabled 
)
pure virtual

This specifies whether view frustum correction is enabled or not.

Parameters
handlethe light handle.
enabledflag specifying whether view frustum positions are corrected. The calculation of it is caused when position or configuration of the camera is changed.

Implemented in AZ::Render::DirectionalLightFeatureProcessor.


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