Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
I would love to see a sample of your work -- maybe even source-code. –  ashes999 Sep 15 '11 at 23:31
    
add comment

2 Answers

up vote 2 down vote accepted
+50

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.

share|improve this answer
    
I've seen that tutorial but I was trying to avoid that method since I was going more for methods that look nice rather than being fast enough for a commercial game. It looks like I'll just have to go that route anyway since there doesn't seem to be any documentation on the cubemap method –  Telanor Sep 23 '11 at 3:44
    
@Telanor If your priority is "nice looking", you could always increase the width and height of the two render targets used to create the DP map. Then you'll have a hi-res texture for the shadows. –  ChrisC Sep 23 '11 at 18:04
add comment

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.

share|improve this answer
    
I haven't tried that specifically because it seemed like the seams would be very obvious, but I'll try it out and see how it looks. Your 2nd suggestion is probably the answer but I'm not sure how to alter the samples to do so, I dont really understand blurs very well –  Telanor Sep 19 '11 at 22:04
    
After working on it on and off for the past 2 days I wasn't able to convert the 2d sampling coordinates to 3d to be able to blur the cubemap correctly, so it looks like I'm going with the dual paraboloid method –  Telanor Sep 23 '11 at 3:48
    
@Telanor, here is an article about doing the cross-face cubemap blurring; maybe that will help. developer.amd.com/media/gpu_assets/… –  Nathan Reed Sep 25 '11 at 19:32
    
Ive seen that article but it's not nearly detailed enough for me. Maybe someone with a lot more experience than I could implement it just by reading a description like that but I'm just a beginner with 3D programming; I need more of a tutorial if I'm to have any hope of implementing it. –  Telanor Sep 26 '11 at 8:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.