   making shadow frustum conform to view frustum
  I want to make my directional shadow map frustum conform to my camera view frustum. I know there are some demos that do this, I have a hard time understanding them. Can anyone give a step by step explanation of how its done?   
  I haven't done this myself, but I would start out by calculating the corners of the frustum that you want to be inside.  Then, based on the location of the 'outer' frustum's origin you could expand or contract the aspect ratio in the vertical and horizontal directions until each of the points are inside.Maybe there is a better way, but that seems like it wouldn't be too difficult to implement and it should be correct.  What do you think?   ;  1. Starting at the centroid of your view frustum, back up in the opposite direction of your light by a certain amount. This will be your temporary working position.2. Come up with a LookAt matrix using your light direction, and your temporary working position. This will be your view matrix that you use when generating the shadow map.3. Transform the 8 corners of your frustum by the LookAt Matrix4. Come up with a bounding box (in light-space) by calculating the min and max X, Y, and Z values from your 8 light-space frustum coordinates.5. Use your min and max values to create an off-center orthographic projection.   ;  thanks, that makes sense.   