Wraps the GPU resources of a ShadowMapping object.
sealed class
|
ShadowMappingResource
|
extends
|
Disposable
|
||
implements
|
IResource
|
The color to use for clearing the shadow map render targets.
public
constant
|
ClearColor
=
Colors.Yellow
|
||
type
|
int64
|
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Returns the estimated memory consumption of this object.
public
property
|
MemoryConsumption
{
get
}
|
||
type
|
int64
|
||
value
|
|
The estimated memory consumption, in bytes. | |
implements
|
IMemoryConsumption.MemoryConsumption
|
Size of the shadow-map render target textures.
public
property
|
TextureSize
{
get
}
|
||
type
|
int32
|
||
value
|
|
The texture size. |
Creates a new instance of ShadowMappingResource.
public
constructor
|
ShadowMappingResource
(ShadowMapping shadowMapping,
IGraphicsContext context)
|
||
params
|
shadowMapping
|
[not-null]
|
The owning ShadowMapping object. |
context
|
[not-null]
|
The graphics context. |
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Applies the render state that is necessary for performing shadow-mapping.
public
method
|
ApplyShadowMap
(ShadowMappingState state)
|
||
params
|
state
|
[not-null]
|
The render state wrapper. |
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Returns the shadow map texture for the given cascade.
public
method
|
GetShadowMapTexture
(int32 cascade)
|
||
type
|
ITexture2D
|
||
params
|
cascade
|
The shadow map cascade (see Cascade). | |
returns
|
|
The shadow map texture. |
Begins to render the shadow map for the given cascade.
public
method
|
RenderShadowMapBegin
(int32 cascade)
|
||
type
|
IRenderTarget
|
||
params
|
cascade
|
The shadow map cascade (see Cascade). | |
returns
|
The
render
target
to
use
or
null
if
the
cascade
is
empty. |
See also:
RenderShadowMapEndFinishes rendering of the shadow map of the current cascade.
public
method
|
RenderShadowMapEnd
(ShadowMappingState state)
|
||
params
|
state
|
The render state wrapper to use for blurring the shadow map using a 7x7 Gauss filter. |
See also:
RenderShadowMapBegin