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)

Visualizing shadow maps


At one point or another, you may find yourself in a situation where one or more lights show some sort of shadow corruption. In this situation it is very helpful to see what is stored in the shadow map in order to determine if the source of the corruption is in the shadow map generation step or in the lighting step.

Shadow map's value range is higher than the 8 bit per pixel that your monitor can display. When just outputting the depth value stored in a shadow map, you are very likely to end up with a gray image that has very low contrast values. In most cases, it will be hard to figure out what is in the shadow map with this form of visualization.

One way to improve the contrast of the shadow map content is to highlight the silhouettes of the shadow map content, which will result in a nice visual outline around the objects. In this recipe we will implement this kind of visualization mode using a very simple technique.

Getting ready

All we will need for this recipe is...