I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really steap, then the egde of the shadow starts to wobble. It's almost looks like it's pulsating.

Could it have something to do with when the light source moves further away from the occluded polygons, the pixels next to each other are further away from each other than the corresponding texels on the shadow map face that I sample from which result in some sort of magnification side-effect when performing aliasing? This is just a really wild guess!

Is anyone familiar with this type of behaviour and/or have any solution to it?

Thank you!

  • \$\begingroup\$ Can you post your shaders and any relevant C++ code? \$\endgroup\$
    – Honeybunch
    Aug 6 '15 at 20:41
  • \$\begingroup\$ In some type of shadowmapping you want to move shadowmap in 1 texel steps (so the texel positions dont change WRT the world). Probably only works for directional lights though. Try applying smoothing/filtering to blur out the shadow edges (or increasing resolution) \$\endgroup\$
    – Waterlimon
    Aug 6 '15 at 23:06
  • \$\begingroup\$ an image would be much better, or a gif (lol). but usually this is called "temporal aliasing" and this is inevitable. Particularly with non orthographic shadows ! with orthographic shadows you can do texel clamping on the steps the shadow camera is allowed to take in world space. But on perspective shadows its game over. You can however implement PCF and it won't show. \$\endgroup\$
    – v.oddou
    Aug 7 '15 at 2:01
  • \$\begingroup\$ Sounds like the typical problem of standard shadow map with step angles ... Look into GL_POLYGON_OFFSET mode which will offset your depth map based on the angle of the view matrix. This way you won't have fighting. If this is not the problem, try to increase resolution of your shadow map. If it is too expensive, use Cascading Shadow Map. \$\endgroup\$ Jul 28 '17 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.