Click or drag to resize
DigitalRuneShadowMaskRenderer Class
Renders the shadow mask from the shadow map of a LightNode.
Inheritance Hierarchy

Namespace: DigitalRune.Graphics.Rendering
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class ShadowMaskRenderer : SceneRenderer

The ShadowMaskRenderer type exposes the following members.

Constructors
  NameDescription
Public methodShadowMaskRenderer(IGraphicsService)
Initializes a new instance of the ShadowMaskRenderer class with a single shadow mask.
Public methodShadowMaskRenderer(IGraphicsService, Int32)
Initializes a new instance of the ShadowMaskRenderer class with the specified number of shadow masks.
Top
Methods
  NameDescription
Public methodCanRender
Determines whether this renderer can handle the specified scene node.
(Overrides SceneRendererCanRender(SceneNode, RenderContext).)
Public methodDispose
Releases all resources used by an instance of the SceneNodeRenderer class.
(Inherited from SceneNodeRenderer.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the SceneNodeRenderer class and optionally releases the managed resources.
(Overrides SceneRendererDispose(Boolean).)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRecycleShadowMasks
Recycles the shadow masks.
Public methodRender(SceneNode, RenderContext)
Renders the specified scene node.
(Inherited from SceneNodeRenderer.)
Public methodRender(IListSceneNode, RenderContext)
Renders the specified scene nodes.
(Inherited from SceneNodeRenderer.)
Public methodRender(IListSceneNode, RenderContext, RenderOrder)
Renders the specified scene nodes.
(Overrides SceneRendererRender(IListSceneNode, RenderContext, RenderOrder).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyFilter
Gets or sets a filter that is applied to the shadow masks as a post-process.
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
(Inherited from SceneNodeRenderer.)
Public propertyMaxNumberOfShadowsMasks
Gets or sets the max number of shadows masks.
Public propertyOrder
Gets the draw order of this scene node renderer.
(Inherited from SceneNodeRenderer.)
Public propertyRenderers
Gets the list of scene node renderers managed by this instance.
(Inherited from SceneRenderer.)
Public propertyShadowMasks
Gets the shadow masks. (For debugging only.)
Public propertyUpsampleDepthSensitivity
Gets or sets a value controlling the bilateral upsampling. (Only used when UseHalfResolution is .)
Public propertyUseHalfResolution
Gets or sets a value indicating whether the shadow mask is created using only the half scene resolution to improve performance.
Top
Remarks

The shadow mask is an image as seen from the camera where for each pixel the shadow info is stored. A value of 0 means the pixel is in the shadow. A value of 1 means the pixel is fully lit. (The shadow mask is rendered into the current render target.)

This renderer renders the shadow masks and sets the properties ShadowMask and ShadowMaskChannel of the handled Shadow instances. The ShadowMaskRenderer handles StandardShadows, CubeMapShadow, CascadedShadows, and CompositeShadows. To handle new shadow types, you need to add a custom SceneNodeRenderer to the Renderers collection.

GBuffer0 needs to be set in the render context.

RecycleShadowMasks should be called every frame when shadow masks are not needed anymore. This method returns all shadow mask render targets to the render target pool and allows other render operations to reuse the render targets.

Render Target and Viewport:
This renderer changes the current render target of the graphics device because it uses the graphics device to render the shadow masks into internal render targets. The render target and the viewport of the graphics device are undefined after rendering.

See Also