top
 
HDRdemo
High Dynamic Range
API's USED:
DirectX 9, FX framework, Max api, Win32
REQUIREMENTS: DirectX 9.0c August 2006 sdk, Shader Model 3.0 hardware.
FILES:
HDRdemo.zip
DESCRIPTION:

There's lots of hype surrounding "High Dynamic Range." Marketing departments tend to play fast and loose with this term. I undertook this project to find out for myself the difference between a true HDR pipeline and a mere bloom filter.

To highlight the differences, this demo runs in four different modes:

1. No HDR: A "standard" pipeline rendering directly to a 32-bit back buffer with no post-processing.

2. Simple Elias Exposure: Adjusts the exposure of the entire scene, then renders to a traditional 32-bit backbuffer.

3. Kawase Bloom Filter: Applies a bright-pass filter to the scene, then ping-pongs the result between render targets, then tone maps this blurred image with an image of the original scene, resulting in a bloom effect. Not "true" HDR, but very fast. Uses four traditional 32-bit render targets. The thumbnail image to the left shows results of this mode.

4. "True" HDR: After rendering the first pass of the scene to a floating-point target, determines the average luminance of the scene by downsampling the scene until arriving at a 1 x 1 texture. The results of the bright-pass filter are blurred by a separable Gaussian filter. The bloom texture and original scene are then tone mapped based on the average luminance, which is the floating-point color value of the 1 x 1 luminance texture. In all, this rendering pipeline uses 11 floating-point targets (compare frame rate on this mode to the others--this version of the pipeline is definitely fill-rate bound!)

What I learned: An actual HDR pipeline uses floating-point render targets, and would also use floating-point texture assets (this demo does not include the latter, hence "True" in quotation marks). Bloom filters, though not actual HDR, achieve much better performance even on the latest generation of graphics hardware.

To really see what the shaders are doing behind the scenes, all the magic numbers for each mode are exposed. In each mode, the demo allows the user to manipulate the exposure, Gaussian mean, number of Kawase iterations etc. to see what effects these have on the final outcome. ALL INSTRUCTIONS are displayed on the screen, making it easy to switch between modes and tweak values.

In each mode, pay attention to the difference between the brightest and darkest regions of the scene. This, in my humble opinion, is what's truly cool about an HDR pipeline--In the "True" HDR mode, the sun appears to burst through the clouds while the front of the statue in the foreground remains cloaked in shadow. Though the other modes boast superior frame rates, none of them offer the dynamic range found in the more expensive final mode.

 

Image 1: Two texture space techniques together: Bloom on a bump mapped surface.

Image 2: Notice the differences between the lightest and darkest regions of the scene in this capture from the "true" HDR mode.

Image 3: Forget bloom... HDR creates possibilities for scene with a wide delta between light and dark, like daybreak over terrain.

 

Back to Main Page

COPYRIGHT 2008 JAMES STEWART. ALL RIGHTS RESERVED. bottom