I am trying to implement VSM Shadow Maps with OpenGL 3.3.
Everything worked fine so far but now I have the same problem as OniDaito who created this thread in 2011: www.opengl.org/discussion_boards/showthread.php/174233-VSM-Shadows-Falloff-inverted
My VSM code is based on this tutorial (fabiensanglard.net/shadowmappingVSM/index.php) and it’s basically plain VSM with a Gussian blur applied to it.
If I use “return max(p_max, 0.4);” in chebyshevUpperBound(), I get this result:
If i use “return max(1.0 - p_max, 0.0);”, this result: (proposed in the above mentioned thread from 2011)
The first one looks pretty good but the gradient/falloff is inverted. (The shadow is bright close to the object and dark farther away)
Has anyone an idea on how to fix this?
[b]PS: I am sorry for not using [IMG] and
. The forum complained always about "too many URL's and forbidden words". Probably a mod can fix this when he sees it. :)[/b]