ok, i think i have found a bug in the OgreHlms.cpp - preparePassHashBase() function which is what caused my PSSM 2nd split plane(shadow_map 1) to muck up and disappear when shadow_map 10 is added.
When the 10th shadow map is used, the "basePropSize" resets the name to only having index "hlms_shadowmap1" as the "propName" instead of "hlms_shadowmap10".
So for example at line: 2141, the propName variable is set to hlms_shadowmap10 correctly, but on the next lines when the propName is resized to have the other appends,
it resets to "basePropSize" which has a size of 15, removing the 0 of the 10 in the "propName" leaving "hlms_shadowmap1" instead.
This resets the propName to hlms_shadowmap1 which then overwrites the second split plane(shadow_map 1) of the pssm instead of handling the 10th shadow map correctly.
For example, this happens at 2148:
Code: Select all
if( shadowTexDef->uvOffset != Vector2::ZERO ||
shadowTexDef->uvLength != Vector2::UNIT_SCALE )
{
propName.resize( basePropSize ); // The "hlms_shadowmap10" is changed into a "hlms_shadowmap1" on propName leaving broken pssm shadows.
propName.a( "_uvs_fulltex" );
setProperty( propName.c_str(), 1 );
}
It then happens to all calls after whenever the "propName" is resized back to the "basePropSize".
e.g. lines: 2156, 2159, 2164, 2167, 2173, 2176, 2181, 2184, 2188, 2195, 2200, 2203, 2208, 2211
I propose that we add say a temp var at the top around line 2139 which will have a basePropsize of 16 instead of 15 if the shadow map index enters a double figure to stop the pssm from breaking.
Otherwise, we can only use shadow_maps 0-9.
I hope this makes sense and that this helps you to be able to fix it

If you dont have time, i will try to come up with a solution tomorrow and post back
