HDR Sample
APIs Used
- GL_COMPUTE_SHADER
- glDispatchCompute
- glMemoryBarrier
- glGenFramebuffers
- glBindFramebuffer
Shared User Interface
The Graphics samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen which lets you interactively control certain variables in each sample.
To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.
Technical Details
Introduction
High Dynamic Range (HDR) imaging has become an essential feature for both photography and game graphics.
Dynamic range is simply defined as the ratio in brightness between the brightest and darkest parts of an image. HDR images allow the full range of brightness in a scene to be captured accurately.
For a full description see: http://en.wikipedia.org/wiki/High-dynamic-range_imaging
Rendering Procedure
Render Scene to an RGBA16F FBO at full dynamic range.
Downsize (filter) scene buffer by 4x in both dimensions for post processing.
Downsize (filter) the result by a further 16x in each dimension. Run a compute shader on the result to generate a single luminance value for auto-exposure calculations.
Extract the highlighted areas for further processing by thresholding luminance values above and below an adjustable cutoff. Scale the result as desired.
Generate a pyramid of processed images, computing another Gaussian blur on each.
Generate highlight streaks in four directions.
Generate ghosted highlight images in 2 passes.
Composite the passes into a final image.
Compress the result to low dynamic range via tonemapping and gamma correction to the onscreen RGB888 framebuffer.
UI
Enable/Disable draw background
Enable/Disable auto exposure
Exposure key adjustment
Select scene
Select material
Select model
Select glare type
References
ftp://download.nvidia.com/developer/presentations/2004/6800_Leagues/6800_Leagues_HDR.pdf
http://en.wikipedia.org/wiki/High-dynamic-range_imaging
http://www.daionet.gr.jp/~masa/
http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter20.html