Imagination PowerVR SDK Blog

Shadow Techniques demo: Collapsing a matrix


Hello, on the 1.1 Shadow Techniques example for Projected Geometry, what is the reasoning behind the routine ShadowMatrix for collapsing the mesh down in the Y axis?



This function generates a matrix which is multiplied with the view matrix and subsequently transforms the teapot mesh such that it appears flattened and sheared in the light direction (i.e a projective shadow). The shadow matrix is multiplied in at the top of the stack - after the view matrix, but before model transform matrices.

This is a common technique that is easy to accomplish and provides a good quality effect as long as the shadow receiver is a flat plane.Arron2011-08-02 11:47:05