Trent Polack's site for cats, games, game development, and undeniably powerful sociological insight all with a healthy dose of narcissism.
The Moving Aftermath and HDR Rendering
Published on September 5, 2005 By mittens In Game Developers
The lack of a comprehensive update in a few days may make a few of you disoriented in your travels, speech, and general being, but I promise, I had good cause. Kind of. Well, not really. But I bring pictures to compensate. Them pixels arrayed in an organized fashion represent the little room that I call home in a very slightly off-campus house with ten other people (all but two of whom I know on a friendly or friendly-ish basis). It's a pretty nice place, actually, and words cannot describe the level of peace that I've reached with just the knowledge that I no longer live in the dorms.

Lately I've been working a lot more with the Torque Shader Engine and, specifically, I've been working on a bloom effect (yay pixel shaders). At first I took the basic "fake bloom" route that every single game within the last two years has both used and abused in a very, very common way. Some games even go so far (or, rather, not nearly far enough) as to just apply a general brightening filter to the entire screen buffer and the end result is primarily an effect that really does nothing more than wash or smudge the clarity of the scene. As of right now the only game I'm aware of that does real HDR (high-dynamic range) is Far Cry, which implemented the HDR effects in a post-release patch (1.3, if my memory serves me). The actual shaders that are primarily responsible for the effect in Far Cry appear to be straight from the DirectX 9.0 SDK "HDRLighting" sample, though the HardOCP article linked would have me believe that it is based entirely on methods presented by OpenEXR (which the SDK gives no reference to). So, either way, the effect exists in Far Cry. And it's pretty.

Before I start showing all the pretty screenshots, let me show a kind of "before" picture set (in the GUI one, focus on the building, not the GUI) that shows what the game looked during a prepubescent period.

With that said, I was lead down a similar path in my work lately. First I decided upon a "fake bloom" method that used similar techniques as mentioned above, but with fairly "hacked" calculations. This produced some of the following screenshots:

I was very unhappy with the overall "look" of the final scene after I had worked with the fake bloom effect. The very, very overly done bloom in the above screenshots is partially to blame on the actual blurring shader that I was using, but the hacked bloom calculations were also just missing something that I couldn't put my finger on. So, after another few hours of work, I was able to figure out how to get the HDR rendering working without too much trouble, and produced these screenshots (with a slightly different blurring algorithm for the shader employed).

The overall look in the above screenshots was what I was going for, as the final produced images just felt a lot more vibrant than anything I had produced before, but this time I would say that the final effect was actually too subtle. I wanted the final effect to be subtle in screenshots (which can never really show this kind of effect very well), but not so subtle as to be really easy to overlook. I then took another solid five-six hours just trying to perfect the blur shaders, and eventually I ended up with an effect that I thought was pretty damn good. The following screenshots are pretty close to the current version I'm working with, though I ended up reducing the area of the blur (which is a separable gaussian blur) by a few pixels since I felt these screenshots were just a bit too overdone.

As of now, I have plans to make the system far more configurable than it currently is, as well as making the HDR bloom adaptive based on the player's exposure to varying environments with their own level of average brightness in a given scene. I'll work on this a bit more, but for now I have to work on a DDS loader.
on Sep 06, 2005
Very nice! It's cool to see the progression from one method to another.