Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter size #2

Closed
jcyuan opened this issue Apr 1, 2021 · 0 comments
Closed

Filter size #2

jcyuan opened this issue Apr 1, 2021 · 0 comments

Comments

@jcyuan
Copy link

jcyuan commented Apr 1, 2021

about calculating the filter size, we need to first calculate the estimation:
imo, to calculate the penumbra size, we can do:

penumbraSize = (dReceiver - dBlocker) / dBlocker * lightSize

actually my questions are from your code:

float SearchWidth(float uvLightSize, float receiverDistance)
{
	return uvLightSize * (receiverDistance - NEAR) / eyePosition.z;
}

for the search area width, i don't know why you use eyePosition.z instead of the shadow space z here, what is the reason? is the eyePosition the main camera in the scene? could you please elaborate?) (http://developer.download.nvidia.com/whitepapers/2008/PCSS_DirectionalLight_Integration.pdf is not available now...)

also, what is the reason you use NEAR / shadowCoords.z here?

float penumbraWidth = (shadowCoords.z - blockerDistance) / blockerDistance;
float uvRadius = penumbraWidth * uvLightSize * NEAR / shadowCoords.z;

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant