Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualRnaodmBiT

Posted 29 March 2013 - 08:30 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.

#1RnaodmBiT

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.

PARTNERS