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::ProjectedShadowFeatureProcessorInterface Class Referenceabstract

This feature processor handles projected shadows for various lights. More...

#include <ProjectedShadowFeatureProcessorInterface.h>

Inherits AZ::RPI::FeatureProcessor.

Inherited by AZ::Render::ProjectedShadowFeatureProcessor.

Classes

struct  ProjectedShadowDescriptor
 Used in SetShadowProperties() to set several related shadow properties in one function call. More...
 

Public Types

using ShadowId = RHI::Handle< uint16_t, ProjectedShadowFeatureProcessorInterface >
 

Public Member Functions

 AZ_RTTI (AZ::Render::ProjectedShadowFeatureProcessorInterface, "{C5651D73-3448-4D76-91C0-0E636A197F63}", AZ::RPI::FeatureProcessor)
 
virtual ShadowId AcquireShadow ()=0
 Creates a new projected shadow and returns a handle that can be used to reference it later.
 
virtual void ReleaseShadow (ShadowId id)=0
 Releases a projected shadow given its ID.
 
virtual void SetShadowTransform (ShadowId id, Transform transform)=0
 Sets the world space transform of where the shadow is cast from.
 
virtual void SetNearFarPlanes (ShadowId id, float nearPlaneDistance, float farPlaneDistance)=0
 Sets the near and far plane distances for the shadow.
 
virtual void SetAspectRatio (ShadowId id, float aspectRatio)=0
 Sets the aspect ratio for the shadow.
 
virtual void SetFieldOfViewY (ShadowId id, float fieldOfView)=0
 Sets the field of view for the shadow in radians in the Y direction.
 
virtual void SetShadowmapMaxResolution (ShadowId id, ShadowmapSize size)=0
 Sets the maximum resolution of the shadow map.
 
virtual void SetShadowBias (ShadowId id, float bias)=0
 Sets the shadow bias.
 
virtual void SetNormalShadowBias (ShadowId id, float normalShadowBias)=0
 Sets the normal shadow bias.
 
virtual void SetShadowFilterMethod (ShadowId id, ShadowFilterMethod method)=0
 Sets the shadow filter method.
 
virtual void SetFilteringSampleCount (ShadowId id, uint16_t count)=0
 Sets the sample count for filtering of the shadow boundary, max 64.
 
virtual void SetUseCachedShadows (ShadowId id, bool useCachedShadows)=0
 
virtual void SetShadowProperties (ShadowId id, const ProjectedShadowDescriptor &descriptor)=0
 Sets all of the shadow properties in one call.
 
virtual const ProjectedShadowDescriptorGetShadowProperties (ShadowId id)=0
 Gets the current shadow properties. Useful for updating several properties at once in SetShadowProperties() without having to set every property.
 
- 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 ()
 

Static Public Attributes

static constexpr float MaxProjectedShadowRadians = AZ::DegToRad(150.0f)
 

Additional Inherited Members

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

Detailed Description

This feature processor handles projected shadows for various lights.

Member Function Documentation

◆ AcquireShadow()

virtual ShadowId AZ::Render::ProjectedShadowFeatureProcessorInterface::AcquireShadow ( )
pure virtual

Creates a new projected shadow and returns a handle that can be used to reference it later.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ GetShadowProperties()

virtual const ProjectedShadowDescriptor & AZ::Render::ProjectedShadowFeatureProcessorInterface::GetShadowProperties ( ShadowId  id)
pure virtual

Gets the current shadow properties. Useful for updating several properties at once in SetShadowProperties() without having to set every property.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ ReleaseShadow()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::ReleaseShadow ( ShadowId  id)
pure virtual

Releases a projected shadow given its ID.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetAspectRatio()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetAspectRatio ( ShadowId  id,
float  aspectRatio 
)
pure virtual

Sets the aspect ratio for the shadow.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetFieldOfViewY()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetFieldOfViewY ( ShadowId  id,
float  fieldOfView 
)
pure virtual

Sets the field of view for the shadow in radians in the Y direction.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetFilteringSampleCount()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetFilteringSampleCount ( ShadowId  id,
uint16_t  count 
)
pure virtual

Sets the sample count for filtering of the shadow boundary, max 64.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetNearFarPlanes()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetNearFarPlanes ( ShadowId  id,
float  nearPlaneDistance,
float  farPlaneDistance 
)
pure virtual

Sets the near and far plane distances for the shadow.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetNormalShadowBias()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetNormalShadowBias ( ShadowId  id,
float  normalShadowBias 
)
pure virtual

Sets the normal shadow bias.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetShadowBias()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetShadowBias ( ShadowId  id,
float  bias 
)
pure virtual

Sets the shadow bias.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetShadowFilterMethod()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetShadowFilterMethod ( ShadowId  id,
ShadowFilterMethod  method 
)
pure virtual

Sets the shadow filter method.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetShadowmapMaxResolution()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetShadowmapMaxResolution ( ShadowId  id,
ShadowmapSize  size 
)
pure virtual

Sets the maximum resolution of the shadow map.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetShadowProperties()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetShadowProperties ( ShadowId  id,
const ProjectedShadowDescriptor descriptor 
)
pure virtual

Sets all of the shadow properties in one call.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetShadowTransform()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetShadowTransform ( ShadowId  id,
Transform  transform 
)
pure virtual

Sets the world space transform of where the shadow is cast from.

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.

◆ SetUseCachedShadows()

virtual void AZ::Render::ProjectedShadowFeatureProcessorInterface::SetUseCachedShadows ( ShadowId  id,
bool  useCachedShadows 
)
pure virtual

Sets if this shadow should be rendered every frame or only when it detects a change. Changes are detected by the presence of a flag on the view which tracks if any of the draws submitted to it contained that flag. The mesh feature processor sets this flag on any cullable that moves, and it is combined with all other flags for draws submitted to each view. See MeshCommon::MeshMovedName for the name of the flag used to track movement See RPI::Scene::GetViewTagBitRegistry() for where the flag bits are determined See RPI::View::GetOrFlags() for how the bits are retrieved

Implemented in AZ::Render::ProjectedShadowFeatureProcessor.


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