Hi stab,
Thanks a lot , it has been fixed:
This is the fix:
in entity_basic.fx
Search for “CalculatePCFPercentLit”:
In this function you should comment out this line putting // infront:
//vShadowTexCoord.z -= 0.0003f + (fCurrentDepth/20000000.0f);
If you search again , and just above the call to this function insert:
// offset shadow pixel depth textcord based on light direction.
float sbias = 0.0003 * tan( acos( clamp( dot(IN.WorldNormal,Ln) ,0.0,1.0) ));
sbias = clamp(sbias, 0.0003f ,0.00009f);
vShadowMapTextureCoord.z -= sbias + (fCurrentPixelDepth/20000000.0f);
Search again , and insert this before the function call.
vShadowMapTextureCoord_blend.z -= sbias + (fCurrentPixelDepth/20000000.0f);
Repeat the above in static_basic.fx
The 3 values can now be adjusted depending on, if the shadow is in light side of the object or shadow side, i tested on different levels but did not see any artifacts , if you find any: these 3 values can be used to make it perfect
In a second i will PM you the link to the latest shader pack, so you can test if everything is fine.
best regards Preben Eriksen,