## Uncharted 2: HDR Lighting at GDC 2010

April 29, 2010First off, thanks to everyone who went to my talk at GDC. As a postscript, I want to add a few things to the general tome of knowledge.

I’ve gotten a zillion requests for the slides, and I finally decided to put them up. You can get the slides here. Watch out: It’s 89 megs and takes a while to load. The presentation is basically four 20 minute presentations crammed into 55 minutes. You can also listen to it at www.gdcvault.com.

I’ve also got a few other goodies hosted right here. It can be hard to understand all the gamma and tonemapping transformations when only seeing snippets in powerpoint. So I put online the RenderMonkey scene that I used to create the images in the presentation. You can find those here: GDC_2010.zip.

Finally, there is that first image that shows the lines of gamma. That one is here as well: Lines_1.png.

Thanks for checking it out, and feel free to hit me up with questions.

Ivan-Assen, on May 4th, 2010 at 5:29 am Said:What exactly do you mean that Jim Hejl’s formula incorporates the pow(1/2.2), and the next formula (with your defaults substituted) doesn’t?

Even when you subject the second formula to a pow(1/2.2), you get nothing that looks like Jim Hejl’s (I played around with a function grapher).

Also, what is the white point in Jim Hejl’s numbers?

admin, on May 4th, 2010 at 10:01 am Said:Hi Ivan. A lot of people seem to be confused about this so I’ll probably make a post about it soon. The short version is that if you do Jim/Richard’s formula then you should output the value directly to the framebuffer. But with the U2 formula, you still need to do a pow(1/2.2) to it. For now, check out the Rendermonkey scene in the GDC post.

Also, the white point is infinite in Jim/Richard’s formula since it converges to 1.0 at infinity.

Ivan-Assen, on May 4th, 2010 at 10:03 pm Said:Thanks for the reply. (And for the original presentation, most of all!)

Sorry I wasn’t clear.

I understood that part – that after Jim/Richard’s you can output directly, while after U2’s you still need to do a pow(1/2.2).

What I was asking was more like how was that additional pow(1/2.2) incorporated into the coefficients (they have essentially the same structure, a ratio of two quadratic polynoms), and how to modify the U2 coefficients to incorporate it. But maybe the answer to this requires some knowledge about approximation theory and a copy of Mathematica?

Is the pow(1/2.2) left out of your formula to keep it directly tweakable?

admin, on May 5th, 2010 at 12:16 am Said:Gotcha. I don’t know how Richard and Jim did it. You’d have to ask them.

We left it out so that it would be a bit more intuitive to tweak, and we had a 1D look-up later in SPUs so it wouldn’t have saved anything. At one point I had grand schemes for doing something complicated to adjust for users with horribly-calibrated monitors. That’s what the 1D look-up was for. At the end we just did a gamma adjustment like everybody else. Funny how that works.

Sergei, on June 2nd, 2010 at 1:49 am Said:Is there any other benefit of that arithmetic filter representation over the Photoshop Levels filter, except the one less pow()?

What I mean is that in terms of control, Levels is far more intuitive imho.

admin, on June 2nd, 2010 at 9:54 am Said:Hi Sergei. Levels is just a multiply, add, and power. In image processing terms, it’s a black point, white point, and gamma. If you do levels on an image, you are still essentially using a linear curve with no shoulder and no toe. So you will still have milky blacks and clipped highlights.

Sergei, on June 3rd, 2010 at 12:27 am Said:Yeah, now I see – with Levels one can make only shoulder or toe, but not both. For that one will need Curves tool.

My only problem about that technique are its not so obvious parameters – an artist can start to test things right away, i.e. before she understands what *exactly* the parameters mean…

Ruud van Gaal, on November 10th, 2010 at 6:38 am Said:No idea yet on how Jim/Richard did the gamma(1/2.2) inclusion in their parameters? I’ve got the UC2 mapping to work, and indeed it’s very nice. It would just be nice to chuck out the pow() for every screen pixel and make it slightly faster.

admin, on November 13th, 2010 at 1:46 pm Said:Yeah, I don’t know the process that they used to include the 1/2.2. I think there was a lot of brute-force tweaking of numbers to get it to look right.

Ambient Occlusion « Santiago Sanchez, on July 16th, 2011 at 1:04 pm Said:[...] car appears to be floating, like it does not belong there. (Images taken from John Hable’s Uncharted 2: HDR Lighting presentation at GDC [...]

Greg Schlottmann, on July 25th, 2011 at 4:56 pm Said:John, I saw this photo and couldn’t help but think about your slides on the importance of AO. Made me laugh

http://www.guardian.co.uk/world/2011/jun/29/chinese-county-ridicule-doctored-photograph

admin, on July 25th, 2011 at 7:54 pm Said:Dude, that’s awesome.

Readings on color management | Light is beautiful, on November 14th, 2012 at 4:00 am Said:[...] a good read! Update: this lengthy presentation of GDC 2010 (quoting: “The presentation is basically four 20 minute presentations crammed into 55 [...]

This is Sparta - Defrost games, on December 28th, 2012 at 2:23 am Said:[...] So why do this matter to us ? Well what happens if yo would like to add together two images that we say have 50% brightness. Well this gives an RGB value of 187 in monitor space. If we add them together we would get a RGB value of 384. Way above the 256 of clear white we expected. However if we first apply the red line to get them back from an over brightened state to the blue line we would be adding 128 with 128 and create the expected 256 (capped at 255 as a max number), afterwards we will have to apply the yellow curve again to get back to what the monitor is exspected but sicne 255 maps to 1 and 1 raised with any power is still 1 everything works out. For extra information look at GPU Gems or John Hables webpage or for more in depth the Uncharted 2 Lightning presentation. [...]