LensFlareRenderer Class |
Namespace: DigitalRune.Graphics.Rendering
The LensFlareRenderer type exposes the following members.
Name | Description | |
---|---|---|
LensFlareRenderer(IGraphicsService) |
Initializes a new instance of the LensFlareRenderer class.
| |
LensFlareRenderer(IGraphicsService, SpriteBatch) | Obsolete.
Initializes a new instance of the LensFlareRenderer class.
|
Name | Description | |
---|---|---|
CanRender |
Determines whether this renderer can handle the specified scene node.
(Overrides SceneNodeRendererCanRender(SceneNode, RenderContext).) | |
Dispose |
Releases all resources used by an instance of the SceneNodeRenderer class.
(Inherited from SceneNodeRenderer.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the SceneNodeRenderer
class and optionally releases the managed resources.
(Overrides SceneNodeRendererDispose(Boolean).) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Render(SceneNode, RenderContext) |
Renders the specified scene node.
(Inherited from SceneNodeRenderer.) | |
Render(IListSceneNode, RenderContext) |
Renders the specified scene nodes.
(Inherited from SceneNodeRenderer.) | |
Render(IListSceneNode, RenderContext, RenderOrder) |
Renders the specified scene nodes.
(Overrides SceneNodeRendererRender(IListSceneNode, RenderContext, RenderOrder).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UpdateOcclusion(SceneNode, RenderContext) |
Performs occlusion queries to determine the visibility of the lens flares effects.
(Requires HiDef profile.)
| |
UpdateOcclusion(IListSceneNode, RenderContext) |
Performs occlusion queries to determine the intensity of the lens flares effects.
(Requires HiDef profile.)
|
Name | Description | |
---|---|---|
IsDisposed |
Gets a value indicating whether this instance has been disposed of.
(Inherited from SceneNodeRenderer.) | |
Order |
Gets the draw order of this scene node renderer.
(Inherited from SceneNodeRenderer.) |
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:
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.
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.