O'Reilly logo

HLSL Development Cookbook by Doron Feinstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HDR rendering

In the previous chapters, we have used an 8 bit per-channel texture for accumulating the lighting calculation results. The main drawback of using this format is that all output values get clamped to the range 0 to 1. On top of that, the precision of values an 8 bit per-channel texture can store is very limited. From this point on we will refer to 8 bit per-channel textures as low dynamic range textures, or LDR for short.

When lighting a bright scene, the accumulated light value may exceed the maximum LDR value of 1. Those bright areas then get clamped to the value of 1 and all the bright details get lost. We call this saturation, because the bright areas saturate the value stored in the LDR texture. To make things worse, dark scenes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required