Inherits AZ::Render::DirectionalLightFeatureProcessorInterface.
Classes | |
struct | CascadeSegment |
struct | ShadowProperty |
Public Member Functions | |
AZ_RTTI (AZ::Render::DirectionalLightFeatureProcessor, "61610178-8DAA-4BF2-AF17-597F20D527DD", AZ::Render::DirectionalLightFeatureProcessorInterface) | |
void | Activate () override |
Perform any necessary activation and gives access to owning Scene. | |
void | Deactivate () override |
Perform any necessary deactivation. | |
void | Simulate (const SimulatePacket &packet) override |
void | PrepareViews (const PrepareViewsPacket &, AZStd::vector< AZStd::pair< RPI::PipelineViewTag, RPI::ViewPtr > > &) override |
void | Render (const RenderPacket &packet) override |
LightHandle | AcquireLight () override |
bool | ReleaseLight (LightHandle &handle) override |
LightHandle | CloneLight (LightHandle handle) override |
void | SetRgbIntensity (LightHandle handle, const PhotometricColor< PhotometricUnit::Lux > &lightColor) override |
void | SetDirection (LightHandle handle, const Vector3 &lightDirection) override |
void | SetAngularDiameter (LightHandle handle, float angularDiameter) override |
void | SetShadowmapSize (LightHandle handle, ShadowmapSize size) override |
void | SetCascadeCount (LightHandle handle, uint16_t cascadeCount) override |
void | SetShadowmapFrustumSplitSchemeRatio (LightHandle handle, float ratio) override |
void | SetCascadeFarDepth (LightHandle handle, uint16_t cascadeIndex, float farDepth) override |
void | SetCameraConfiguration (LightHandle handle, const Camera::Configuration &cameraConfiguration, const RPI::RenderPipelineId &renderPipelineId=RPI::RenderPipelineId()) override |
void | SetShadowFarClipDistance (LightHandle handle, float farDist) override |
void | SetCameraTransform (LightHandle handle, const Transform &cameraTransform, const RPI::RenderPipelineId &renderPipelineId=RPI::RenderPipelineId()) override |
void | SetGroundHeight (LightHandle handle, float groundHeight) override |
void | SetViewFrustumCorrectionEnabled (LightHandle handle, bool enabled) override |
void | SetDebugFlags (LightHandle handle, DebugDrawFlags flags) override |
void | SetShadowFilterMethod (LightHandle handle, ShadowFilterMethod method) override |
void | SetFilteringSampleCount (LightHandle handle, uint16_t count) override |
void | SetShadowReceiverPlaneBiasEnabled (LightHandle handle, bool enable) override |
void | SetCascadeBlendingEnabled (LightHandle handle, bool enable) override |
Sets whether or not blending between shadow map cascades is enabled. | |
void | SetShadowBias (LightHandle handle, float bias) override |
Reduces acne by applying a small amount of bias along shadow-space z. | |
void | SetNormalShadowBias (LightHandle handle, float normalShadowBias) override |
Reduces acne by biasing the shadowmap lookup along the geometric normal. | |
void | SetFullscreenBlurEnabled (LightHandle handle, bool enable) override |
Sets whether or not to apply fullscreen blur after fullscreen shadow pass. | |
void | SetFullscreenBlurConstFalloff (LightHandle handle, float blurConstFalloff) override |
Sets the amount of constant falloff on the fullscreen shadow blur. | |
void | SetFullscreenBlurDepthFalloffStrength (LightHandle handle, float blurDepthFalloffStrength) override |
Sets the strength of the depth falloff on the fullscreen shadow blur. | |
void | SetAffectsGI (LightHandle handle, bool affectsGI) override |
Specifies if this light affects the diffuse global illumination in the scene. | |
void | SetAffectsGIFactor (LightHandle handle, float affectsGIFactor) override |
Specifies the contribution of this light to the diffuse global illumination in the scene. | |
const Data::Instance< RPI::Buffer > | GetLightBuffer () const |
uint32_t | GetLightCount () const |
ShadowProperty & | GetShadowProperty (LightHandle handle) |
Public Member Functions inherited from AZ::Render::DirectionalLightFeatureProcessorInterface | |
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) | |
Scene * | GetParentScene () 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 () |
Static Public Member Functions | |
static void | Reflect (ReflectContext *context) |
Additional Inherited Members | |
Public Types inherited from AZ::Render::DirectionalLightFeatureProcessorInterface | |
enum | DebugDrawFlags : uint32_t { DebugDrawNone = 0b000 , DebugDrawColoring = 0b001 , DebugDrawBoundingBoxes = 0b010 , DebugDrawAll = ~DebugDrawNone } |
using | LightHandle = RHI::Handle< uint16_t, class DirectionalLight > |
Protected Member Functions inherited from AZ::RPI::FeatureProcessor | |
void | EnableSceneNotification () |
void | DisableSceneNotification () |
|
overridevirtual |
This creates a new directional light which can be referenced by the returned LightHandle. This must be released via ReleaseLight() when no longer needed.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Perform any necessary activation and gives access to owning Scene.
Reimplemented from AZ::RPI::FeatureProcessor.
|
overridevirtual |
This creates a new LightHandle by copying data from an existing LightHandle.
lightHandle | the handle to clone. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Perform any necessary deactivation.
Reimplemented from AZ::RPI::FeatureProcessor.
|
overridevirtual |
This releases a LightHandle which removes the directional light.
lightHandle | the handle to release. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
The feature processor should enqueue draw packets to relevant draw lists.
Reimplemented from AZ::RPI::FeatureProcessor.
|
overridevirtual |
Specifies if this light affects the diffuse global illumination in the scene.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Specifies the contribution of this light to the diffuse global illumination in the scene.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets a directional light's angular diameter. This value should be small, for instance the sun is 0.5 degrees across.
handle | the light handle. |
angularDiameter | Directional light's angular diameter in degrees. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets camera configuration which affect to cascade segmentation.
handle | the light handle. |
cameraConfiguration | the camera configuration. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets camera transform which affect to cascade segmentation.
handle | the light handle. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Sets whether or not blending between shadow map cascades is enabled.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets cascade count of the shadowmap.
handle | the light handle. |
cascadeCount | the count of cascade (from 1 to 4). |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets the far depth of the cascade. If this is called, the ratio of frustum split scheme will be ignored.
handle | the light handle. |
cascadeIndex | the index of the cascade to be changed. |
farDepth | the far depth to be set. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This specifies what debug features to display.
handle | the light handle. |
flags | flags specifying the debug features. See DebugDrawFlags for more info. By drawing debug colors and bounding boxes, we can see how cascading of shadowmaps works. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets the direction of the light. direction should be normalized.
handle | the light handle. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets sample count for filtering of shadow boundary.
handle | the light handle. |
count | Sample Count for filtering (up to 64) |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Sets the amount of constant falloff on the fullscreen shadow blur.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Sets the strength of the depth falloff on the fullscreen shadow blur.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Sets whether or not to apply fullscreen blur after fullscreen shadow pass.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This specifies the height of the ground.
handle | the light handle. |
groundHeight | height 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. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Reduces acne by biasing the shadowmap lookup along the geometric normal.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets the intensity in RGB lux for a given LightHandle.
handle | the light handle. |
lightColor | the intensity in RGB lux. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Reduces acne by applying a small amount of bias along shadow-space z.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets shadow specific far clip depth. Pixels beyond the far clip depth do not receive shadows. Reducing this value improves shadow quality.
handle | the light handle. |
farDist | the far clip depth. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This specifies filter method of shadows.
handle | the light handle. |
method | filter method. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
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.
handle | the light handle. |
ratio | the 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. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This sets the shadowmap size (width and height) of the light.
handle | the light handle. |
size | the shadowmap size (width/height). |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
Sets whether the directional shadowmap should use receiver plane bias. This attempts to reduce shadow acne when using large pcf filters.
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
This specifies whether view frustum correction is enabled or not.
handle | the light handle. |
enabled | flag specifying whether view frustum positions are corrected. The calculation of it is caused when position or configuration of the camera is changed. |
Implements AZ::Render::DirectionalLightFeatureProcessorInterface.
|
overridevirtual |
The feature processor should perform any internal simulation at this point - For instance, updating a particle system or animation. Not every feature processor will need to implement this.
Reimplemented from AZ::RPI::FeatureProcessor.