Book Image

HLSL Development Cookbook

By : Doron Feinstein
Book Image

HLSL Development Cookbook

By: Doron Feinstein

Overview of this book

3D graphics are becoming increasingly more realistic and sophisticated as the power of modern hardware improves. The High Level Shader Language (HLSL) allows you to harness the power of shaders within DirectX 11, so that you can push the boundaries of 3D rendering like never before.HLSL Development Cookbook will provide you with a series of essential recipes to help you make the most out of different rendering techniques used within games and simulations using the DirectX 11 API.This book is specifically designed to help build your understanding via practical example. This essential Cookbook has coverage ranging from industry-standard lighting techniques to more specialist post-processing implementations such as bloom and tone mapping. Explained in a clear yet concise manner, each recipe is also accompanied by superb examples with full documentation so that you can harness the power of HLSL for your own individual requirements.
Table of Contents (13 chapters)

Adaptation


Now that we added HDR rendering support, you may have noticed that our average luminance value is very unstable when the content of the HDR image changes due to camera movement or changes in the scene. This instability results in noticeable changes to the tone mapping range which changes the brightness of the LDR image.

When we move from a bright to a dark area, our eyes need some time to gradually adapt to these changes. This recipe adds a similar adaptation to our average luminance calculation to smooth those kinds of transitions.

Getting ready

Adding adaptation will require an additional buffer to store the previous frame's luminance. This buffer should have the exact same descriptor values as the average luminance buffer we added in the preceding recipe. Similar to the average luminance buffer, the new buffer will also require a UAV and SRV. On each frame we render, we will store the average luminance into one of the buffers and read the previous frames average luminance from...