Graphics Reference
In-Depth Information
By using this approach, it is clear that the number of fragments that need to be processed by
the pixel shader are greatly reduced for the first two lights. The last light, however, potentially
wastes time processing pixels that have no content. This could be addressed by using the
stencil buffer when rendering the geometry into the G-Buffer and enabling stencil testing
within the subsequent lighting pass. By using the stencil buffer, we could exclude any portions
of the screen that do not have anything rendered or that we do not want to participate in the
lighting pass. A prime example is the skybox of outdoor scenes, where potentially a large
portion of the screen does not require any lighting operations. As with render targets,
the depth buffer cannot be bound for reading and writing at the same time. In order for us to
use the depth buffer from the G-Buffer stage as both, an SRV to retrieve position information
and for depth testing, we have created a read-only DSV using DepthStencilViewFlags .
dsvDesc.Flags = DepthStencilViewFlags.ReadOnlyDepth;
There's moreā€¦
There are of course many ways to optimize the rendering of lights for deferred rendering.
One is to use the rasterizer stage's scissor test, allowing a region of the screen to be enabled
to render while culling anything that would be rendered outside this region. Another approach
for efficient lighting is tiled deferred rendering, where the screen is divided into imaginary
tiles. Lights that impact a specific tile are grouped and processed together (also known as
light binning).
See also
F Overview of a number of different deferred rendering techniques along with example
code can be found in Deferred Rendering for Current and Future Rendering Pipelines
by Andrew Lauritzen , Beyond Programmable Shading, SIGGRAPH 2010, July 2010
at http://visual-computing.intel-research.net/art/publications/
deferred_rendering/
F Stencil buffer for deferred lights at http://www.altdevblogaday.
com/2011/08/08/stencil-buffer-optimisation-for-deferred-lights/
F Light Indexed Deferred Rendering at https://code.google.com/p/
lightindexed-deferredrender/
F Performance comparison of light indexed deferred rendering and tiled deferred
rendering at http://mynameismjp.wordpress.com/2012/03/31/light-
indexed-deferred-rendering/
 
Search WWH ::




Custom Search