Click or drag to resize
DigitalRuneLensFlareRenderer Class
Renders LensFlareNodes.
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 LensFlareRenderer : SceneNodeRenderer

The LensFlareRenderer type exposes the following members.

Constructors
  NameDescription
Public methodLensFlareRenderer(IGraphicsService)
Initializes a new instance of the LensFlareRenderer class.
Public methodLensFlareRenderer(IGraphicsService, SpriteBatch) Obsolete.
Initializes a new instance of the LensFlareRenderer class.
Top
Methods
  NameDescription
Public methodCanRender
Determines whether this renderer can handle the specified scene node.
(Overrides SceneNodeRendererCanRender(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 SceneNodeRendererDispose(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 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 SceneNodeRendererRender(IListSceneNode, RenderContext, RenderOrder).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdateOcclusion(SceneNode, RenderContext)
Performs occlusion queries to determine the visibility of the lens flares effects. (Requires HiDef profile.)
Public methodUpdateOcclusion(IListSceneNode, RenderContext)
Performs occlusion queries to determine the intensity of the lens flares effects. (Requires HiDef profile.)
Top
Properties
  NameDescription
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
(Inherited from SceneNodeRenderer.)
Public propertyOrder
Gets the draw order of this scene node renderer.
(Inherited from SceneNodeRenderer.)
Top
Remarks

The lens flare renderer performs hardware occlusion queries to determine the visibility of the lens flares. The query results are delayed by one or more frames, which means that lens flares need at least two frames to become visible.

Lens flares need to be rendered in two passes:

  1. Occlusion Queries -

    The method UpdateOcclusion(IListSceneNode, RenderContext) needs to be called after the scene is rendered. The Z-buffer of the current render target needs to contain the depth information of the scene. The method performs a hardware occlusion query to check the visibility of the light source. In a deferred lighting renderer the method can be called at the end of the "Material" pass. No pixels are rendered into the current render target during the occlusion queries.

    Hardware occlusion queries only run in HiDef profile. The method has no effect when run in Reach profile.

  2. Render Pass -

    The method needs to be called to render the lens flares into the current render target. The method can be called at any point after the occlusion queries.

Reach Profile: The LensFlareRenderer does not determine the visibility of the lens flares because hardware occlusion queries are not supported in Reach profile. Lens flares in front of the camera are always visible. As a workaround: Create a new class derived from LensFlare and override OnGetSizeAndIntensity(LensFlareNode, RenderContext, Int32, Int32, Single, Single). In this method determine the visibility of the light source, for example, by using a ray-test.

Render Target and Viewport:
This renderer renders into the current render target and viewport of the graphics device.

See Also