View Full Version : Gamma correct texturing scene: Suggestions?

Alfonse Reinheart
10-16-2011, 02:09 PM
I'm working on Tutorial 16 in my series, which focuses on a full linear pipeline, from textures to framebuffers. The problem I have is a lack of an effective demonstration.

I want to introduce the problem of sRGB textures and such by showing off a lit scene of something that uses textures that aren't properly linearized. But I need a scene where the effects of linearization will be clear and very noticeable by the reader of the tutorials.

What kind of scene and textures would you suggest? A darker scene with less illumination? Should the texture be fairly dark with a few bright spots, or should it be bright? Would a high-contrast texture better show off the issues with non-linearity, or a lower contrast one? And what is a good way to show off what happens if you use mipmaps that weren't generated gamma-correctly?

10-17-2011, 02:35 AM
Classic example of bad mipmaps is black and white checkerboard filtered to 0.5, showing in perspective. Show gamma correct filtering on one side of the screen. Another neat example is Gamma error in browsers (http://www.4p8.com/eric.brasseur/gamma_dalai_lama.html)

10-17-2011, 09:36 AM
sRGB differs from linear most in the lower-midtones (it's essentially X^(1/2.2), so 0 and 1 are the same). A scene with gradual lighting dropoffs and textures that have a even histogram would probably be your best bet. Lighting that is done in sRGB space will appear to dropoff too quickly on curved surfaces and attenuate too quickly with distance. You'll probably only want to use 1 light for demonstration purposes.

The rule of thumb we have here regarding color correction is to linearize all inputs, do all rendering, and then only correct the final result. Generally there are two main errors - forgetting to linearize an input (like using a JPG for a texture, which is gamma 2.2 by default), or applying the color correction twice to an element.

1. Using an sRGB or gamma 2.2 image for a texture in a linear lighting workflow without linearizing it will cause that texture to look overexposed and washed out in the final sRGB result. Applying sRGB correction twice will also cause this error, which could happen in a post-process pass or deferred renderer.

2. Displaying a linear image without correction will result in an image that looks dark & highly contrasted, almost like it was taken in outer space.

If you show these errors in your tutorial, they should be easily visible in a side-by-side comparison. I suppose the trick will be convincing people that the sRGB/linear workflow is the correct image.

10-17-2011, 11:50 AM
Linear workflow in blender :

A more natural check for mipmaps in linear mode is something with hairs, I can find the exact picture but I remember a close up macro of a bee was significantly off without a proper linear render pipeline.
Eg :

Dark Photon
10-17-2011, 04:41 PM
Related posts -- might give some ideas:

* http://renderwonk.com/blog/index.php/archive/adventures-with-gamma-correct-rendering/
* http://filmicgames.com/archives/299
* http://filmicgames.com/archives/327
* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
* http://beautifulpixels.blogspot.com/2009/10/gamma-correct-lighting-on-moon.html