A small thought occurred to me: there's an object people are familiar with that will help them to understand, the moon:
Two spheres lit by a directional light, compared with an image of the moon.
Which has gamma correct math?
Which has gamma correct math?
Still don't see it.. yes, it's subtle... shall we make it obvious with a gradient?
Yes, it is but one example, there are many more. But it's a good basic visual example.
If you'd like to read more on gamma correct rendering:
- Chris Tchou, HDR The Bungie Way
- Larry Gritz & Eugene d'Eon, The Importance of Being Linear in GPU Gems 3
- Steve Smith Picture Perfect: Gamma through the Rendering Pipeline presentation
(A better article version is available in the Xbox 360 documentation) - Alex Vlachos, Post Processing in The Orange Box, GDC 2008 presentation
[EDIT: See the comments for some nice thoughts from people who've spent more time on this.
Naty points out another good example in Real Time Rendering.]
Thanks to "ComputerHotline" on openphoto.net for the image of the moon.
Isn't the moon often used also as an example of how Oren-Nayar can produce better results than the plain old Lambertian model? I assume the above images are using Lambert, is that right?
ReplyDeleteEither way, it's clear that the one on the right is more correct than the one on the left. It's amazing how many games I see that appear to have gotten this wrong.
The moon exhibits quite a bit of backscattering, such that the area near the terminator is brighter than a normal Lambertian surface. Is the lighting model closer to standard in that photo, now that the light source (sun) is perpendicular to the view direction?
ReplyDeletehttp://books.google.com/books?id=4PxR6Nq4jqIC&pg=PA54&lpg=PA54&dq=moon+%22non-lambertian%22&source=bl&ots=UIcxUzTgEm&sig=U78FNPem-C4GE51sM40d5Z21uw0&hl=en&ei=10d2Spy9C4K0Nr-2_LAM&sa=X&oi=book_result&ct=result&resnum=1#v=onepage&q=moon%20%22non-lambertian%22&f=false
I agree with the image on the right is the gamma correct rendering. Though, I disagree with your experiment.
ReplyDeleteThe moon has large facets (mountains) that reflects light back towards the person standing on the ground. The lambert BRDF you chose to render isn't representative of the moon.
Look at Oren-Nayar for a BRDF that represents the moon better. (In fact the first commercial use of Oren-Nayar was a TV spot that had a moon in the background).
-= Dave
In the third edition of "Real-Time Rendering", we used an image that communicates this quite well, I think. You can also see it on an old blog post of mine, about a quarter of the way down: http://renderwonk.com/blog/index.php/archive/adventures-with-gamma-correct-rendering/
ReplyDeleteThe image on the right may be more correct, but the image on the left is more appealing.
ReplyDeleteI don't think that your moon analogy is very strange or wrong. Actually, when I first experimented with gamma correction, my first thought was (when viewing a gray sphere): "hey, that looks like the moon now!".
ReplyDeleteVery cool, I didn't really understand the issue with gamma adjustment before. Thanks for linking to the article, and I think your moon example makes a lot of sense.
ReplyDeleteIt's a nice example.
ReplyDeleteI also think there is something worth considering in Anonymous' comments that the one on the left is more "appealing".
Without any reference to correctness, the left does have a more noticable gradient. I could argue that this pronounced gradient helps define the shape of the sphere more clearly. It's 'more obviously' a sphere. I'd suggest it also looks less like the moon, but cheating to help the perception of shape is not necessarily a bad thing.
Excellent entry! I'm been looking for topics as interesting as this. Looking forward to your next post.
ReplyDelete