Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Trent "mittens" Polack

Plan for Trent "mittens" Polack
Name:Trent "mittens" Polack
Date Posted:Sep 06, 2005
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Trent "mittens" Polack

Blog post
Summary of my work on HDR rendering in the Torque Shader Engine.
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.

[image]http://polycat.net/gallery/albums/earlytorquetests/roughgui_72505.thumb.j... [image]http://polycat.net/gallery/albums/earlytorquetests/gun_testing.thumb.jpg[...

With that said, I was led 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:

[image]http://polycat.net/gallery/albums/earlytorquetests/hackbloom.thumb.jpg[/i... [image]http://polycat.net/gallery/albums/earlytorquetests/hackbloom2.thumb.jpg[/...

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).

[image]http://polycat.net/gallery/albums/earlytorquetests/hdrbloom_blurtype1_1.t... [image]http://polycat.net/gallery/albums/earlytorquetests/hdrbloom_blurtype1_2.t...

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.

[image]http://polycat.net/gallery/albums/earlytorquetests/hdrbloom_blurtype2_1.t... [image]http://polycat.net/gallery/albums/earlytorquetests/hdrbloom_blurtype2_2.t...

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.

Recent Blog Posts
List:09/06/05 - Plan for Trent "mittens" Polack
08/08/05 - Plan for Trent "mittens" Polack
07/30/05 - Plan for Trent "mittens" Polack
07/20/05 - Plan for Trent "mittens" Polack
07/19/05 - Plan for Trent "mittens" Polack
07/16/05 - Plan for Trent "mittens" Polack
07/15/05 - Plan for Trent Polack

Submit ResourceSubmit your own resources!

Tek0   (Sep 06, 2005 at 04:40 GMT)
Very cool, that looks awesome! I like how you made the GUIs like HL2, very nice. I can't wait to see more awesome HDR Screenshots!

Great Job!

Timothy Aste   (Sep 06, 2005 at 04:42 GMT)
Wow! I snagged the link to the gallery a few days ago on IRC and prompty passed it around the office. Really sweet!

Adam deGrandis   (Sep 06, 2005 at 06:36 GMT)
What Tim says is entirely correct. The general response around the office was "whoa....". Very cool, Trent!

James Laker (BurNinG)   (Sep 06, 2005 at 10:03 GMT)
Very cool!

Andrew Nicholson   (Sep 06, 2005 at 10:46 GMT)
Nice, very nice!

Linhart Walter   (Sep 06, 2005 at 17:45 GMT)
awesome work mittens!

Logan Foster   (Sep 06, 2005 at 19:23 GMT)
Some very awesome work here indeed

Trent "mittens" Polack   (Sep 06, 2005 at 19:49 GMT)
Thanks for the kind words, guys.

Neil Marshall   (Sep 06, 2005 at 20:55 GMT)
I saw the second pair of screenshots when you posted the links on IRC a week back. Looking good!

Tom Spilman   (Sep 07, 2005 at 01:02 GMT)
Looks good. I always felt the DX9 HDRLighting sample sucked. I didn't like the slow brightening of the screen that occurred as, i guess, it is simulating the retina adjusting to the dark environment. I think this is called Tone Mapping. I was planning on looking into integration of HDR, so i'm glad to see others are starting to do it.

Trent "mittens" Polack   (Sep 07, 2005 at 01:21 GMT)
Tone mapping doesn't necessarily relate to the adaptive quality of the DX9 sample; tone mapping encompasses a number of different effects (bloom for one), but also refers to is a kind of "blue shift" that the demo does to make dark areas a bit more screen-friendly. You see this all the time in movies that take place in purely dark environments; instead of the screen being pitch black, the overall tone of the scene is dark blue which tells the audience that the person is actually in a pitch black environment, but allows us to actually see what is going on on-screen instead of, and it pains me to say this, leaving the audience in the dark. In general, tone mapping is a digital way of compensating for natural optical phenomenon (bigwordsarefun). Here's a nice paper on it: www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf

The brightening and darkening fo the screen is the adaptive thing I make a brief reference to in my post. This kind of effect isn't something I actually really like all too much, but for some games it's a nice feature. It's also not too hard to implement.

Tom Spilman   (Sep 07, 2005 at 01:24 GMT)
Seems like Doom3 could have used a crap load of tone mapping then. =)

Trent "mittens" Polack   (Sep 07, 2005 at 03:27 GMT)
That was a low blow. :P

Mark McCoy   (Sep 07, 2005 at 05:40 GMT)
Now you just need one of these monitors: www.brightsidetech.com/products/dr37p.php

Of course you'll have sell your liver on the black market to pay for one.. heh.

You must be a member and be logged in to either append comments or rate this resource.