Ok, I've took the liberty to attempt adding multiple shadow map per light
support in ogre. This is to allow custom shadow mapping like PSSM or Cubic
shadow map(point light).
Along the way, I found the long problematic issue I had with directional
lights on Focussed and LiSPSM camera setup. They didn't seem to follow the
render backface flag. After some hacking, I managed to solve the issue
which is included in this patch. I'm not entirely sure if my solution makes
sense or if it's correct. But it does get the job done. I basically flip
the Z frustum of the Focussed camera for directional light. As for LiSPSM,
I flipped the Z frustum when building the unit cube frustum. This solution
seemed to produce correct result for the shadow demo as well. Previously,
LiSPSM mode is rendering the front face instead of the back face.
Anyways, here's a list of what has been modified:
- Added multiple shadow map per light support to scene manager.
- Modified ShadowCameraSetup and SceneManager::Listener to have shadow map
iteration param.
- Fixed up render pass codes to set texture projector param with the right
shadow texture unit index. (it was using shadow texture index which is
wrong. Should be index base on the shadows in that pass.)
- Changed AutoParam of shadow_scene_depth_range to be per shadow texture
unit instead of light.
- "Fixed" Focussed camera setup for directional light.
- "Fixed" LiSPSM frustum setup.
- Fixed Focussed and LiSPSM to get shadow camera bound info directly
instead of using the light.
Note:
I did not modify build in shadow pass as multiple shadow map there does not
make sense.
Also I believe getShadowCasterBoundsInfo() should be removed as it doesn't
make sense anymore in multiple shadow map system. Besides, I've removed all
dependency to this function on this patch.
P.S. Sorry for such a huge patch with so many changes.
http://sourceforge.net/tracker/index.ph ... tid=302997
Here's a screen shot of my PSSM working with these changes:

3 1024x1024 shadow map. PSSM+LiSPSM+PCF.
<Shameless plug>Btw, this is an inhouse level editor shot i did for aftershock. I haven't revealed this part to the showcase yet. Maybe soon when I feel ready.

</Shameless plug>