HLSL Development Cookbook – Review

I just picked up a copy of the new HLSL Development Cookbook. The book is a great continuation of the very basic shader set up I have implemented in the XNA tutorial engine, but goes into much more complex and deeper shaders taking full advantage of the new possibilities provided by DirectX 11.

The book tends to be pretty source heavy (HLSL source that is) with very little C++ or DirectX code being shown, so it is definitely recommended to at least have a basic grasp of setting up a simple DirectX 11 application works before tackling the content. On the bright side though, all of the HLSL source is explained in great detail including many diagrams to help get across more of the complicated concepts that aren’t necessarily obvious just from reading the code itself. One thing I really got from these descriptions and diagrams was a good explanation of how the half angle optimization for Blinn Specular works. I always knew how to write the code for this technique but never really understood the real reasoning behind why it works until now.

If you found the samples in my lighting tutorials helpful at all, then you will love the first chapter of this book. The same basic layout is used in all of the shaders that I introduced, but right away a more advanced look at using different light types and effects are included. Each “recipe” builds on top of the last one, so going through the whole chapter one sample at a time is a great way to build your knowledge of all the standard lighting types and shaders normally used.

Once you have a firm grasp of the different shading models and techniques for each light type, Chapter 2 will take you into the much more complicated but also more high performance world of Deferred Shading. Using the new Hull and Domain shader functionality provided by DirectX 11, much of the hard work of optimizing the steps of Deferred Shading are easily handled. All of the complexities of basic Hull and Domain shaders are explained while developing the model, and each light type from the first chapter is then implemented in a single flexible shader that can eventually handle multiple lights (up to 4) in a single rendering pass.

After Deferred Shading, the much more advanced and complex techniques of shadow maps, post processing, screen space effects like ambient occlusion and “god rays”, and environmental effects like fog and decals are discussed in depth. There is too much content to go in to in a simple review, so why don’t you go pick up a copy and see for yourself how great the recipes in this title are and how much you can learn from it! I know I’ll be using the techniques in future development.

Book Link:

Sample Chapter:

Leave a Reply

You must be logged in to post a comment.

Do NOT follow this link or you will be banned from the site!