MSAA multisampling is essential to create stable, non-flickering images for VR applications. Shadowmapping however is not working correctly with MSAA, resulting in hard edges where lit objects overlap shadowed areas.
The basic idea of this fix is to apply FXAA to the shadowmask in order to smooth edges. This solution uses a GrabPass in the shader and might not be the most efficient, but it works fine and allows alternative shadows like NGSS.
No MSAA:
MSAA - no fix:
MSAA - no fix:
Add MsaaShadowFix to any directional light. A commandbuffer is added on enable.
Great thanks to mattdesl for providing the fxaa shader code here: https://github.com/mattdesl/glsl-fxaa