This topic is 2028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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:

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

##### Share on other sites

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

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632936
• Total Posts
3009312
• ### Who's Online (See full list)

There are no registered users currently online

×