Jump to content

  • Log In with Google      Sign In   
  • Create Account


Question about Variance Shadow Mapping


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 gchewood   Members   -  Reputation: 234

Like
0Likes
Like

Posted 28 March 2013 - 10:35 PM

I've just got variance shadow maps working in my game (I'm using XNA) but something

curious occurs to me. I'm using what I assume is the standard algorithm:

 

http://fabiensanglard.net/shadowmappingVSM/

http://electronicmeteor.wordpress.com/2011/11/06/xna-4-0-variance-shadow-mapping-sample/

 

I don't see why it's necessary to use the moments to calculate the variance, use chebyshev's upper

bound etc etc. Assuming you've already blurred the shadow map, why can you just use read each

pixel's occlusion directly from the r component?

 

It seems to work fine (if anything it looks better). I assume it's gonna cause a problem further down the line

though or people wouldn't have bothered with all those extra lines of code??

 

Thanks



Sponsor:

#2 Lightness1024   Members   -  Reputation: 677

Like
0Likes
Like

Posted 29 March 2013 - 08:44 AM

isn't it a question of diminishing artefacts like light leaks ?



#3 RnaodmBiT   Members   -  Reputation: 540

Like
1Likes
Like

Posted 29 March 2013 - 08:23 PM

If you examine the depth texture after your blur you'll find it has been linearly blurred. By using the r and g components we can store the depth value and its square which both get linearly blurred by your blur function. If you compare the interpolated values between two pixels you will find the r component squared will be less then the g component (which contains the original squared value). This difference which is increased over a change in depth is what is used to calculate whether a pixel is in shadow or not as a probabilistic function. If you simply used r and r squared instead of g you would find there is never any difference which would mean the pixel is never in shadow.

If simply used the depth after you're blur you would get a hard edged shadow since you would be comparing the depth of the pixel against the blurred value in a function that only returns lit or shadowed. The blur itself is only acting on the depth values before you turn them into shadows.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS