August 2013

# HLSL Development Cookbook - Contest Winners

Aug 2013

Congratulations to Tommy, czoper and Mark for winning digital copies of HLSL Development Cookbook, the book I had just reviewed.

HLSL Development Cookbook

Comments | #competitions #books Share

# Book Review: HLSL Development Cookbook

Aug 2013

I've been given a chance to read a book HLSL Development Cookbook published recently by Packt Publishing. Below you can find my review. Packt has proposed to offer 3 digital copies of the book. Keep reading to find out how you can win a copy.

The book has 224 pages. Its author - Doron Feinstein - works as Senior Graphics Programmer in Rockstar Games. The book is about implementing various rendering techniques in HLSL using DirectX 11. It uses new features of this API, e.g. geometry shaders, compute shaders, UAV, tesselation etc. It presents very professional approach and does not over-simply anything for educational purposes (for example, the author uses linear space for color computations, explains HDR rendering and passes reciprocal value as constant where appropriate as multiplication is faster than division).

The book assumes that reader already knows DirectX API and is able to code a framework that loads meshes, textures, constant buffers and all the stuff and pass it to GPU rendering. He should also already know the concept of shaders and the HLSL syntax, not to mention math/geometry basics of 3D graphics (like properties of dot product or transformation matrix). So this is definitely not a book for complete beginners who want to learn game programming from scratch. It does not even give complete shaders to just copy-paste into your engine, but fragments (functions) that are interesting in some technique. Which I think is good, because where per-pixel parameters of your material come from (like albedo color, normal vector, specular intensity and exponent) - whether from texture, a constant or some computations - is up to you and the book focuses on what to do with it without boring, multipage code listings.

Subsequent chapters cover following topics:

  1. Forward lighting: Describes straightforward implementation of different types of lights - hemispheric ambient light, directional light, point light, spot light and capsule light (with explanation of Lambert law for diffuse, and Blinn-Phong model of specular), as well as texture projection from point light and spot light.
  2. Deferred Shading: Introduces concept of deferred lighting (requires rendering geometry 2 times) versus deferred shading (requires rendering geometry 1 time, used in this book). Mentions different ways of storing nomals in GBuffer and of course reconstructing world-space position from Z-buffer depth. Shows implementation of same types of lights in the deferred way.
  3. Shadow Mapping: Covers shadows from spot lights and point lights, PCF (Percentage-Closer Filtering), Cascaded Shadow Maps for directional light, PCF with varying prenumbra size and visualizing shadow maps with silhouettes highlighting.
  4. Postprocessing: Describes HDR Rendering (calculates average luminance for tone mapping in compute shader) with exposure adaptation, Bloom, DOF (Depth of Field) and Bokeh (all done on GPU).
  5. Screen-space effects: Describes SSAO (Screen Space Ambient Occlusion), lens flare (using occlusion query and predicate query), reflections and sun rays, all done as screen-space effects.
  6. Environment effects: Describes dynamic decals (as an example of using stream out feature to generate mesh on GPU), distance/height-based fog and rain (as simple example of stateful particle system colliding with scene geometry, calculated entirely on GPU).

That's not a "gems"-style book with every chapter being a separate article written by different author. But each chapter is a complete "recipe" for a rendering technique, whether an implementation of particular type of light or some other visual effect. Each one of them is divided into sections:

As you can see, described topics are not some sophisticated and specialized effects like rendering foam on an ocean coast or crowd on a stadium, but fundamental techniques needed by every engine. Just as the book says: "Lighting and postprocessing are two of the most important fields in 3D rendering."

Summary: This book is not intended for complete beginners, but if only it fits the knowledge you already have and the knowledge you currently seek, I think this it can be a great step on you path of learning game/graphics programming.

Now here is how you can have a chance to win eBook copy of this book: All you need to do is head on over to the book page, look through the product description of the book and then drop a line via the comments below this post to let us know what interests you the most about this book. 3 best comments win!!! Deadline: The contest will close in 1 weeks time. Winners will be contacted by email (before the end of this month), so be sure to use your real email address when you comment.

Comments | #books #competitions #reviews Share

# Smart Pointers in C++11 - My Article in ProgramistaMag

Aug 2013

In new issue 7/2013 (14) of Programista magazine there is my next article (in Polish) - "Inteligentne wskaźniki w C++11" (Smart Pointers in C++11). This is a long one. In this article I introduce the problem of manual memory management in C++ along with the concept of object lifetime and the matter of object ownership. I then describe RAII idiom and explain what smart pointer mean. I describe features of smart pointer classes available in C++11 standard library (auto_ptr, unique_ptr, shared_ptr, weak_ptr) and show how to use them with short examples. I also touch some additional topics like writing custom deleters and show source code of custom implementation of a simple smart pointer.

You can find the magazine e.g. in Empik stores, as well as subscribe for electronic or paper version.

Comments | #c++ #productions Share

[Stat] [STAT NO AD] [Download] [Dropbox] [pub] [Mirror]
Copyright © 2004-2017