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

Delegate for managing light shape specific functionality in the AreaLightComponentController. More...

#include <LightDelegateBase.h>

Inherits AZ::Render::LightDelegateInterface, LmbrCentral::ShapeComponentNotificationsBus::Handler, and AZ::TransformNotificationBus::Handler.

Public Member Functions

 LightDelegateBase (EntityId entityId, bool isVisible)
 
void SetConfig (const AreaLightComponentConfig *config) override
 Sets the area light component config so delegates don't have to cache the same data locally.
 
void SetChroma (const Color &chroma) override
 Sets the color of the light independent of light intensity. The color is a mask on the total light intensity.
 
void SetIntensity (float intensity) override
 Sets the light intensity.
 
float SetPhotometricUnit (PhotometricUnit unit) override
 Sets the light unit, and returns the converted light intensity.
 
void SetAttenuationRadius (float radius) override
 Sets the maximum distance from any part of the surface of the area light at which this light will have an effect.
 
const PhotometricValue & GetPhotometricValue () const override
 Gets the light intensity.
 
void SetLightEmitsBothDirections (bool lightEmitsBothDirections) override
 Sets if this shape is double-sided (only applicable for 2d shapes).
 
void SetUseFastApproximation (bool useFastApproximation) override
 
void SetVisibility (bool visibility) override
 Turns the visibility of this light on/off.
 
void SetEnableShutters (bool enabled) override
 
void SetShutterAngles (float innerAngleDegrees, float outerAngleDegrees) override
 
void SetEnableShadow (bool enabled) override
 Sets if shadows should be enabled.
 
void SetShadowBias (float bias) override
 Sets the shadow bias.
 
void SetShadowmapMaxSize (ShadowmapSize size) override
 Sets the maximum resolution of the shadow map.
 
void SetShadowFilterMethod (ShadowFilterMethod method) override
 Sets the filter method for the shadow.
 
void SetFilteringSampleCount (uint32_t count) override
 Sets the sample count for filtering of the shadow boundary, max 64.
 
void SetEsmExponent (float esmExponent) override
 Sets the Esm exponent to use. Higher values produce a steeper falloff between light and shadow.
 
void SetNormalShadowBias (float bias) override
 Sets the normal bias. Reduces acne by biasing the shadowmap lookup along the geometric normal.
 
void SetShadowCachingMode (AreaLightComponentConfig::ShadowCachingMode cachingMode) override
 
void SetAffectsGI (bool affectsGI) override
 Sets if the light should affect diffuse global illumination.
 
void SetAffectsGIFactor (float affectsGIFactor) override
 Sets the multiplier on the contribution to diffuse global illumination.
 
void SetLightingChannelMask (uint32_t lightingChannelMask) override
 Set the lighting channel mask.
 
void SetGoboTexture (AZ::Data::Instance< AZ::RPI::Image > goboTexture) override
 
- Public Member Functions inherited from AZ::Render::LightDelegateInterface
virtual float GetSurfaceArea () const =0
 Gets the surface area of the shape.
 
virtual float GetEffectiveSolidAngle () const =0
 Returns the number of steradians covered by this light type.
 
virtual float CalculateAttenuationRadius (float lightThreshold) const =0
 Calculates the attenuation radius for this light type based on a threshold value.
 
virtual void DrawDebugDisplay (const Transform &transform, const Color &color, AzFramework::DebugDisplayRequests &debugDisplay, bool isSelected) const =0
 Handle any additional debug display drawing for beyond what the shape already provides.
 
virtual Aabb GetLocalVisualizationBounds () const =0
 Returns the Aabb for the debug visualization of the light.
 

Protected Member Functions

void InitBase (EntityId entityId)
 
FeatureProcessorType * GetFeatureProcessor () const
 
const AreaLightComponentConfigGetConfig () const
 
FeatureProcessorType::LightHandle GetLightHandle () const
 
const Transform & GetTransform () const
 
bool GetShuttersEnabled ()
 
bool GetShadowsEnabled ()
 
virtual void HandleShapeChanged ()=0
 
void OnShapeChanged (ShapeChangeReasons changeReason) override
 
void OnTransformChanged (const Transform &local, const Transform &world) override
 

Protected Attributes

LmbrCentral::ShapeComponentRequests * m_shapeBus = nullptr
 

Detailed Description

template<typename FeatureProcessorType>
class AZ::Render::LightDelegateBase< FeatureProcessorType >

Delegate for managing light shape specific functionality in the AreaLightComponentController.

Member Function Documentation

◆ GetPhotometricValue()

template<typename FeatureProcessorType >
const PhotometricValue & AZ::Render::LightDelegateBase< FeatureProcessorType >::GetPhotometricValue ( ) const
inlineoverridevirtual

Gets the light intensity.

Implements AZ::Render::LightDelegateInterface.

◆ SetAffectsGI()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetAffectsGI ( bool affectsGI)
inlineoverridevirtual

◆ SetAffectsGIFactor()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetAffectsGIFactor ( float affectsGIFactor)
inlineoverridevirtual

Sets the multiplier on the contribution to diffuse global illumination.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::QuadLightDelegate, AZ::Render::SimplePointLightDelegate, AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetAttenuationRadius()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetAttenuationRadius ( float radius)
overridevirtual

Sets the maximum distance from any part of the surface of the area light at which this light will have an effect.

Implements AZ::Render::LightDelegateInterface.

◆ SetChroma()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetChroma ( const Color & chroma)
overridevirtual

Sets the color of the light independent of light intensity. The color is a mask on the total light intensity.

Implements AZ::Render::LightDelegateInterface.

◆ SetConfig()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetConfig ( const AreaLightComponentConfig * config)
overridevirtual

Sets the area light component config so delegates don't have to cache the same data locally.

Implements AZ::Render::LightDelegateInterface.

◆ SetEnableShadow()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetEnableShadow ( bool enabled)
inlineoverridevirtual

Sets if shadows should be enabled.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetEnableShutters()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetEnableShutters ( bool enabled)
inlineoverridevirtual

◆ SetEsmExponent()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetEsmExponent ( float exponent)
inlineoverridevirtual

Sets the Esm exponent to use. Higher values produce a steeper falloff between light and shadow.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetFilteringSampleCount()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetFilteringSampleCount ( uint32_t count)
inlineoverridevirtual

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

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetGoboTexture()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetGoboTexture ( AZ::Data::Instance< AZ::RPI::Image > goboTexture)
inlineoverridevirtual

◆ SetIntensity()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetIntensity ( float intensity)
overridevirtual

Sets the light intensity.

Implements AZ::Render::LightDelegateInterface.

◆ SetLightEmitsBothDirections()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetLightEmitsBothDirections ( bool lightEmitsBothDirections)
inlineoverridevirtual

Sets if this shape is double-sided (only applicable for 2d shapes).

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::PolygonLightDelegate, and AZ::Render::QuadLightDelegate.

◆ SetLightingChannelMask()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetLightingChannelMask ( uint32_t lightingChannelMask)
overridevirtual

Set the lighting channel mask.

Implements AZ::Render::LightDelegateInterface.

◆ SetNormalShadowBias()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetNormalShadowBias ( float bias)
inlineoverridevirtual

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

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetPhotometricUnit()

template<typename FeatureProcessorType >
float AZ::Render::LightDelegateBase< FeatureProcessorType >::SetPhotometricUnit ( PhotometricUnit unit)
overridevirtual

Sets the light unit, and returns the converted light intensity.

Implements AZ::Render::LightDelegateInterface.

◆ SetShadowBias()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetShadowBias ( float bias)
inlineoverridevirtual

◆ SetShadowCachingMode()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetShadowCachingMode ( AreaLightComponentConfig::ShadowCachingMode cachingMode)
inlineoverridevirtual

Sets the current shadow caching mode. Cached shadows use persistent textures and only update when they detect a change. Regular shadows use transient textures but re-render every frame.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetShadowFilterMethod()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetShadowFilterMethod ( ShadowFilterMethod method)
inlineoverridevirtual

Sets the filter method for the shadow.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetShadowmapMaxSize()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetShadowmapMaxSize ( ShadowmapSize size)
inlineoverridevirtual

Sets the maximum resolution of the shadow map.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::SimpleSpotLightDelegate, and AZ::Render::SphereLightDelegate.

◆ SetShutterAngles()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetShutterAngles ( float innerAngleDegrees,
float outerAngleDegrees )
inlineoverridevirtual

◆ SetUseFastApproximation()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetUseFastApproximation ( bool useFastApproximation)
inlineoverridevirtual

Sets if this light uses linearly transformed cosines (false) or a faster approximation (true). Only applicable for shapes that support LTC.

Implements AZ::Render::LightDelegateInterface.

Reimplemented in AZ::Render::QuadLightDelegate.

◆ SetVisibility()

template<typename FeatureProcessorType >
void AZ::Render::LightDelegateBase< FeatureProcessorType >::SetVisibility ( bool visibility)
overridevirtual

Turns the visibility of this light on/off.

Implements AZ::Render::LightDelegateInterface.


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