March 15, 2008

Normal mapping

I've added normal mapping to each of the skinned shadowing routines. To achieve this binormals and tangents were added to my vertex declaration and exported. The normal map is decoded in the pixel shader and a simple dot product used against the light vector made from multiplying the world space light vector and 3x3 matrix formed from tangent, binormal and normal.

March 10, 2008

Queried Virtual Shadow Maps

The latest uploaded shadow map technique is QVSM. The QVSM paper describes an approach where a large virtual texture can be used for the shadow map through several tiling and rendering schemes.

'Tech' demo 11 uses their brute force approach to tile shadow maps with multi-pass rendering. This is slow, but the paper goes on to discuss improved algorithms. I'm going to try these next.

I realised the first shadow map examples used a perspective matrix. I should have used an orthogonal perspective matrix for the light projection. This makes better use of the texture so the shadow map has a higher effective resolution.

March 04, 2008

Archived shaders

I use archives to organise data at a packing stage. They also reinforce a stringent memory layout as the game is running. Archives are just a collection of resources. For example, a vertex buffer, material and texture are resources.

The HLSL shaders are now resources. This enables the renderer to hot-swap between different shaders for the same model. "Tech" demo 10 shows a comparison between shadow maps and Variance Shadow Maps. The shader resource has enabled easy shadowing of the motion capture guy.