Hi guys,
I've come across a little oddity in the shadow system while working on my WIP.
In mode 2 there seems to be a *lot* of displacement of the shadow when doing a 360 degree turn, in comparison to mode 1 and 3.
It's so much that it actually comes loose from the model and it appears as if the model(s) has moved upwards(optical illusion).
I understand there are quality differences between modes 1, 2 and 3, since the help file says:
Quote: "SetShadowMappingMode
Description
Turns shadow mapping on or off, by default this is off. Shadows are only generated by the the global directional light, which can be controlled with the SetSunDirection command. Note that this is not guaranteed to be supported on all devices, you can check for the current device by calling GetShadowMappingSupported. There are currently three shadow modes that can be used, mode 1 uses Uniform shadow mapping which has lower but consistent quality. Mode 2 uses Light Space Perspective shadow mapping (LiPSM) which has higher quality in most cases but if the camera is looking in the same direction as the light then it is no better than Uniform shadow mapping. Light Space Perspective also suffers from shadow shimmering as the camera moves whereas Uniform is more stable. Both have about the same performance. Mode 3 uses Cascade shadow mapping which uses multiple shadow maps to maintain high quality near the camera whilst still allowing lower quality shadows in the distance. This method has much lower performance than the previous two methods but results in better quality shadows in all cases.
Note that when using modes 1 and 2, texture stage 7 on all objects receiving shadow is reserved for the shadow map. When using shadow mode 3 (cascade shadows) then texture stages 4, 5, 6, and 7 are reserved for the shadow maps. "
But it doesn't say that in mode 2 it's actually doing this displacement, decreasing it's quality advantage over mode 1. Is there a way round it, or something you guys can fix - for instance depending on the cam orientation, move the shadow more close to the object that's casting?
I've done some research(with pictures) under this thread:
Universal 1st/3rd person AppGameKit framework(without physics)#msg2634585
*A link to the source can be found in last post if anybody wants to test, shadow modes are switchable using F7.
Hope you guys can explain or if necessary fix, for mode 2 works best performance/quality wise.
[EDIT: corrected typo]