Hello,
I have implemented Variance Shadow Mapping (VSM). It works with OpenGl, dx9 and dx11.
In order to add softness to shadows, this method allows to post-process the shadow map.
At the moment, it’s a 7x7 gaussian blur, but the user can use his own filter with the function Renderer::SetShadowMapFilter(Object* instance, ShadowMapFilter functionPtr).
Another notable change is the ShadowQuality, now it’s an enum :
enum ShadowQuality
{
SHADOWQUALITY_SIMPLE_16BIT = 0,
SHADOWQUALITY_SIMPLE_24BIT,
SHADOWQUALITY_PCF_16BIT,
SHADOWQUALITY_PCF_24BIT,
SHADOWQUALITY_VSM,
SHADOWQUALITY_BLUR_VSM
};
The drawback of this technique is the light bleeding, but in the lighting shader, there is a trick to reduce it.
The link to my fork :
I just need to add function in Renderer to set the shadow softness and the light bleeding reduction.
If it’s ok, I can propose a PR.