Class ShadowMapProvider
This class is responsible to manage all shadows of this scene.
Implements
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class ShadowMapProvider : DisposableObject, IDisposable
Constructors
ShadowMapProvider(DefaultRenderPipeline)
Initializes a new instance of the ShadowMapProvider class.
Declaration
public ShadowMapProvider(DefaultRenderPipeline renderPipeline)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultRenderPipeline | renderPipeline | The render pipeline. |
Fields
DirectionalShadowMapArray
Texture to hold all directional lights depth maps.
Declaration
public Texture DirectionalShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
DirectionalShadowMapFramebuffers
The directional shadowmap framebuffer array.
Declaration
public FrameBuffer[] DirectionalShadowMapFramebuffers
Field Value
| Type | Description |
|---|---|
| FrameBuffer[] |
NumCascades
Cascade count used in directional lights.
Declaration
public const uint NumCascades = 4
Field Value
| Type | Description |
|---|---|
| uint |
PunctualShadowMapArray
Texture to hold all point lights depth maps.
Declaration
public Texture PunctualShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
PunctualShadowMapFramebuffers
The punctual shadowmap framebuffer array.
Declaration
public FrameBuffer[] PunctualShadowMapFramebuffers
Field Value
| Type | Description |
|---|---|
| FrameBuffer[] |
ShadowViewProjectionBuffer
Gets the shadow view projection buffer pointer.
Declaration
public IntPtr ShadowViewProjectionBuffer
Field Value
| Type | Description |
|---|---|
| IntPtr |
ShadowViewProjectionBufferSize
Gets the shadow view projection buffer size.
Declaration
public uint ShadowViewProjectionBufferSize
Field Value
| Type | Description |
|---|---|
| uint |
SpotShadowMapArray
Texture to hold all spot lights depth maps.
Declaration
public Texture SpotShadowMapArray
Field Value
| Type | Description |
|---|---|
| Texture |
SpotShadowMapFramebuffers
The spot shadowmap 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()
Reset the slice counters.
Declaration
public void BeginFrame()
Destroy()
Destroy all resources of this instance.
Declaration
protected override void Destroy()
Overrides
ExtendShadowMapSlot(LightType)
Extend the capacity of the shadow map textures.
Declaration
public void ExtendShadowMapSlot(LightType type)
Parameters
| Type | Name | Description |
|---|---|---|
| LightType | type | The type of light that need a slot. |
NextDirectionalShadowMapFramebuffer(LightDrawContext, int)
Get the next free 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)
Get 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)
Get 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)
Reduce the capacity of the shadow map textures.
Declaration
public void ReduceShadowMapSlot(LightType type)
Parameters
| Type | Name | Description |
|---|---|---|
| LightType | type | The type of light that need a slot. |
RefreshLightProjection(LightDrawContext, int)
Refresh 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)
Set 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()
Reset the current slice.
Declaration
public void ResetDirectionalCurrentSlice()