Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (6 posts)

Shadow swimming issue

Last post 7/28/2011 1:58 AM by Goss. 5 replies.
  • 7/27/2011 7:59 PM

    Shadow swimming issue

    I've implemented basic shadow mapping with PCF and I don't know how to fix the swimming issue. I did some research and it appears the only fix is implement PSM or CSM? Is that true?
  • 7/27/2011 8:10 PM In reply to

    Re: Shadow swimming issue

    Define "swimming".  Are you referring to the shimmer effect on the shadow edges if you move the camera?  The way to solve that is to either a) not move the light's view or projection matrix, or b) make sure you only move the light on increments of whole shadow map texels.  PSM or CSM have nothing to do with it.
  • 7/27/2011 8:23 PM In reply to

    Re: Shadow swimming issue

    Yep exactly. Your first solution worked. THANKS!. However, I don't understand your second solution.
  • 7/27/2011 8:33 PM In reply to

    Re: Shadow swimming issue

    Answer
    Reply Quote
    Goss:
    However, I don't understand your second solution.


    Think of the shadow map as being part of an infinite plane, aligned with its normal pointed along the light direction.  Normally you position the shadow map so that it can cover your entire scene, and you usually want to be able to move it around to follow the camera.  The trick is, you don't want to move it continuously - you want to move it in increments the same size as the texels in the shadow map.  Otherwise the texels around the edge of an object are constantly going in and out of shadow depending on what are effectively rounding errors.  That causes the shimmer.

    Check out this sample for an implementation that solves it, iirc:  http://mynameismjp.wordpress.com/samples-tutorials-tools/deferred-shadow-maps-sample/
  • 7/27/2011 8:35 PM In reply to

    Re: Shadow swimming issue

    Thanks a lot Sigil! That makes a lot more sense.
  • 7/28/2011 1:58 AM In reply to

    Re: Shadow swimming issue

    blank
Page 1 of 1 (6 posts) Previous Discussion Next Discussion
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG