A while back I showed off bloom, a simple effect that blurs the bright areas of the image to make them appear to glow. Now I present to you full HDR rendering with tone mapping.
For those of you who aren't familiar with the concept of HDR, I'll explain. Without HDR, the color space of a video game is limited from black (SColor(255, 0, 0, 0)) to white (SColor(255, 255, 255, 255)). This is quite unlike real life, as the white of paint on a wall is much, much dimmer than the light of the sky or the sun. HDR simulates real life much more closely by rendering the entire scene using floating-point render targets which are able to store a much broader light spectrum than standard color buffers.
Since your screen can still only display the low dynamic range (24-bit black to white), tone mapping is then used to scale the image back down to the screen color space. It does this by calculating the average brightness of the entire image (a "middle gray") and dividing all color values by this amount.
Put shortly and simply, the scene now mimics your eye. In darker areas, the scene adapts and things become brighter. In brighter areas, darker objects look even darker compared to bright lights. Looking at the first screenshot, we can see that the tone mapped image and the original image are fairly similar since nothing is exceptionally bright. Looking at the second image, however, we can see that the sun (which is 7 times brighter than the rest of the scene) makes everything else look much darker in comparison.
Click on each pic to view it in its full 1440 x 900 glory.



The screenshots can't really speak for HDR - you have to see the transition from darkness to light and then back again:
http://www.youtube.com/watch?v=mZXZyMTHFKg
You can also check it out by downloading it below. The source is included. Note that it requires DirectX 9.0 with Shader Model 2, though as with all but the simplest of post-processing, decent hardware is required to get > 20 fps. Anyone who wants to port this to OpenGL/GLSL can feel free to do so and post it here.
Download:
http://www.filefront.com/17272734/HDR.zip
EDIT: I compiled my Irrlicht.dll with the June 2010 DirectX SDK (the latest version). This means you need to either make sure you have the latest DirectX runtime (found at http://www.microsoft.com/downloads/en/d ... laylang=en) or you need to recompile the solution with your build of Irrlicht. Either way it shouldn't be a big deal at all.
Enjoy!