I've been working on implementing variance shadow mapping for my game. I was able to get a spot light working with variance shadow mapping with a gaussian blur applied to the shadow map to reduce the aliasing. Now I'm trying to implement point lights but I'm not sure how to adapt the gaussian blur to work with the the shadow map when its stored in a cube map. I've searched around for a while but I can't seem to find any examples that use point lights. Can anyone help me out here?
|
|
There is an example of how to do variance shadow mapping with point lights, but it uses dual paraboloid mapping instead of cube mapping. The tutorial with the example is shown here. If you're willing to deal with a bit less detail than cube maps, DP variance shadow mapping is easier to code, and requires two textures instead of six saving you some memory. You also only have one seam to hide. Point lights are usually the hardest kind of lights to apply shadow mapping to (and consume more memory), which is why many games do not use them so often. |
|||||
|
|
When I've implemented this before, I just blurred each cube face individually, using a standard 2D Gaussian blur. You can potentially introduce seams at cube edges, because the blur doesn't go across them, but in my experience this was hardly ever noticable. YMMV, of course. You could probably even do a blur across cube edges by writing a blur shader that would take its input in the form of a cubemap, and distribute samples around a 3D vector, sampling a cone of directions. That sounds tricky and slow, though, so I'd try just blurring each face individually first. |
|||||||||
|