Linear vs. Gamma Color Space

Some engines will render their scenes internally in linear color space, where gamma correction is removed from all source imagery (using sRGB textures for example.) A good write-up describing how this can improve illumination is “The Importance of Being Linear” in GPU Gems 3.

If your engine works this way, and you want to use the SilverLining Sky, 3D Cloud, and Weather SDK or the Triton Ocean SDK while rendering in linear color space, you’ll find that the sky and ocean appear too bright. By default, SilverLining and Triton produce gamma-corrected images intended to be displayed on a monitor as-is. If your engine applies gamma correction later in the pipeline, the sky and ocean end up getting gamma corrected twice as a result.

There is a simple solution. Triton offers the Triton::Ocean::SetLinearColorSpace() method, which may be used to render the ocean in the darker linear color space instead. SilverLining offers even finer control with the SilverLining::Atmosphere::SetGamma() method – by default SilverLining assumes a gamma value of 2.2, but by setting the gamma to 1.0 you’ll get results in linear color space instead.

If you are using the Unity Pro engine, it also has an option for linear color space rendering. The next releases of SilverLining and Triton for Unity will automatically handle this, but for now you may refer to this and this for tips on using our products with linear color space in Unity.

One finer point: whether you’re in linear or gamma color space, you’ll want to make sure any reflection textures given to Triton are in gamma space. For example, if you are using SilverLining to produce an environmental cube map for Triton, make sure Atmosphere::SetGamma(2.2) is called prior to calling Atmosphere::GetEnvironmentMap(). If you cannot easily generate reflection textures in gamma space, contact us for guidance on modifying Triton’s shaders to only correct the non-reflection components of the water.