PCSS

Started by
1 comment, last by Althar 9 years, 5 months ago

Hi all.
I trying make PCSS with use whitepaper:

http://developer.download.nvidia.com/whitepapers/2008/PCSS_Integration.pdf
http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf
But i can't understand what is

NEAR_PLANE 9.5
LIGHT_WORLD_SIZE .5
LIGHT_FRUSTUM_WIDTH 3.75
in first w
hitepaper in the HLSL code, and can't understand what is the formulas:
searchWidth = LIGHT_SIZE_UV * (zReceiver - NEAR_PLANE) / zReceiver
and

filterRadiusUV = penumbraRatio * LIGHT_SIZE_UV * NEAR_PLANE / coords.z.

Please help me.

Advertisement

somebody, please help.
How calculate relation between (lightSize and distance) and sizeWindowSample ???

Hello NEvOI,

The penumbra width calculation is the following : lightSize * (zReceiver - zBlocker ) / zBlocker . Effectively, the penumbra width is approximated by the distance ratio between the receiver & the blocker depth, modulated by a constant :

  • The zReceiver depth is the depth of the fragment (in your shadow map) you are trying to shade
  • The zBlocker depth is the average depth (in your shadow map) around the receiver fragment.
  • The lightSize will be a fixed constant in world-space.

Put simply, the further apart zReceiver and zBlocker are, the bigger the penumbra - similarly, as zReceiver tends towards zBlocker, the penumbra width will tend to 0.

I am not sure where you got sizeWindowSample from, but I have had good results, with just this simple formula above. The papers you mention calculate a dynamic search width based on various parameters but aren't really needed to get it working : a fixed search width does the trick.

Hope this helps?

This topic is closed to new replies.

Advertisement