Uncharted 2: HDR Lighting at GDC 2010


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

17 Responses to “Uncharted 2: HDR Lighting at GDC 2010”

  1. 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?


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


  3. 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?


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


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


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


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


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


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


  10. [...] car appears to be floating, like it does not belong there. (Images taken from John Hable’s Uncharted 2: HDR Lighting presentation at GDC [...]


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


  12. Dude, that’s awesome.


  13. [...] a good read! Update: this lengthy presentation of GDC 2010 (quoting: “The presentation is basically four 20 minute presentations crammed into 55 [...]


  14. [...] 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. [...]


  15. [...] as much of the contrast as possible.I ended up choosing an algorithm created by John Hable for Uncharted 2.vec3 Uncharted2Tonemap(vec3 x){ float A = [...]


  16. [...] of the contrast as possible.I ended up picking an algorithm produced by John Hable for Uncharted 2.vec3 Uncharted2Tonemap(vec3 x) float A = .15 float B = .50 float C = .10 float D = .20 float E = [...]


  17. I have been to Italy. lovely country. the girls look great. Like, what the hell is THAT? I wanted to take a picture but I was frozen . anyway, he didn’t want to pee so she struggled with him a bit and then eventually he pees. Arms dangling limp in front of him as his mom held him leaning forward.
    jordan montante http://www.atoutvisa.com/vente-chaussure.asp?id=jordan-montante


Leave a Reply