Class ShadowMapProvider
This class is responsible for managing all shadows in this scene.
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class ShadowMapProvider : DisposableObject
Constructors
ShadowMapProvider(DefaultRenderPipeline)
Initializes a new instance of the ShadowMapProvider class.
Declaration
public ShadowMapProvider(DefaultRenderPipeline renderPipeline)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultRenderPipeline | renderPipeline | The rendering pipeline. |
Fields
DirectionalShadowMapArray
Texture to hold all directional lights' depth maps.
Declaration
public Texture DirectionalShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
DirectionalShadowMapFramebuffers
The directional shadow map framebuffer array.
Declaration
public FrameBuffer[] DirectionalShadowMapFramebuffers
Field Value
| Type | Description |
|---|---|
| FrameBuffer[] |
NumCascades
The cascade count used in directional lights.
Declaration
public const uint NumCascades = 4
Field Value
| Type | Description |
|---|---|
| uint |
PunctualShadowMapArray
Texture that holds all point lights' depth maps.
Declaration
public Texture PunctualShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
PunctualShadowMapFramebuffers
The punctual shadow map framebuffer array.
Declaration
public FrameBuffer[] PunctualShadowMapFramebuffers
Field Value
| Type | Description |
|---|---|
| FrameBuffer[] |
ShadowViewProjectionBuffer
Gets the shadow view projection buffer pointer.
Declaration
public nint ShadowViewProjectionBuffer
Field Value
| Type | Description |
|---|---|
| nint |
ShadowViewProjectionBufferSize
Gets the shadow view projection buffer size.
Declaration
public uint ShadowViewProjectionBufferSize
Field Value
| Type | Description |
|---|---|
| uint |
SpotShadowMapArray
Texture to hold all spotlights' depth maps.
Declaration
public Texture SpotShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
SpotShadowMapFramebuffers
The spot shadow map framebuffer array.
Declaration
public FrameBuffer[] SpotShadowMapFramebuffers
Field Value
| Type | Description |
|---|---|
| FrameBuffer[] |
Properties
DirectionalShadowMapResolution
Gets or sets the directional shadow map texture size.
Declaration
public ShadowMapProvider.ShadowMapSize DirectionalShadowMapResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| ShadowMapProvider.ShadowMapSize |
PunctualShadowMapResolution
Gets or sets the punctual shadow map texture size.
Declaration
public ShadowMapProvider.ShadowMapSize PunctualShadowMapResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| ShadowMapProvider.ShadowMapSize |
ShadowFilter
Gets or sets the global shadow filter.
Declaration
public ShadowMapProvider.Filter ShadowFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| ShadowMapProvider.Filter |
SpotShadowMapResolution
Gets or sets the spot shadow map texture size.
Declaration
public ShadowMapProvider.ShadowMapSize SpotShadowMapResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| ShadowMapProvider.ShadowMapSize |
Methods
BeginFrame()
Resets the slice counters.
Declaration
public void BeginFrame()
Destroy()
Destroys all resources of this instance.
Declaration
protected override void Destroy()
Overrides
ExtendShadowMapSlot(LightType)
Extends the capacity of the shadow map textures.
Declaration
public void ExtendShadowMapSlot(LightType type)
Parameters
| Type | Name | Description |
|---|---|---|
| LightType | type | The type of light that needs a slot. |
NextDirectionalShadowMapFramebuffer(LightDrawContext, int)
Gets the next available shadow framebuffer.
Declaration
public void NextDirectionalShadowMapFramebuffer(LightDrawContext lightDrawContext, int cascadeIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| LightDrawContext | lightDrawContext | The active light draw context. |
| int | cascadeIdx | The cascade index. |
NextPunctualShadowMapFramebuffer(LightDrawContext, int)
Gets the next free shadow framebuffer.
Declaration
public void NextPunctualShadowMapFramebuffer(LightDrawContext lightDrawContext, int faceIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| LightDrawContext | lightDrawContext | The active light draw context. |
| int | faceIdx | The cube face index. |
NextSpotShadowMapFramebuffer(LightDrawContext, int)
Gets the next free shadow framebuffer.
Declaration
public void NextSpotShadowMapFramebuffer(LightDrawContext lightDrawContext, int cascadeIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| LightDrawContext | lightDrawContext | The active light draw context. |
| int | cascadeIdx | The cascade index. |
ReduceShadowMapSlot(LightType)
Reduces the capacity of the shadow map textures.
Declaration
public void ReduceShadowMapSlot(LightType type)
Parameters
| Type | Name | Description |
|---|---|---|
| LightType | type | The type of light that needs a slot. |
RefreshLightProjection(LightDrawContext, int)
Refreshes the light projection.
Declaration
public void RefreshLightProjection(LightDrawContext lightDrawContext, int slot)
Parameters
| Type | Name | Description |
|---|---|---|
| LightDrawContext | lightDrawContext | The light draw context. |
| int | slot | The slot index. |
ReserveShadowMapSlots(Light, uint)
Sets a valid shadowMap slot.
Declaration
public void ReserveShadowMapSlots(Light light, uint slots)
Parameters
| Type | Name | Description |
|---|---|---|
| Light | light | The light. |
| uint | slots | The slots needed. |
ResetDirectionalCurrentSlice()
Resets the current slice.
Declaration
public void ResetDirectionalCurrentSlice()