0
\$\begingroup\$

I'm doing research to implement a shadow algorithm for omnidirectional soft shadows in a real-time 3D renderer. I've read about PCF but to me it doesn't look very realistic since it doesn't "fade" with the distance to the blocker like PCSS would.

The problem is PCSS uses the penumbra radius to simulate the "fade" effect which omnidirectional lights don't create. Therefore, only lights that do produce a penumbra (like area lights) are natively supported by the algorithm.

So I'll break this question into 2:

  1. Can I still use PCSS on omnidirectional lights by "cheating" and applying a tweaked constant value as the light area parameter?

  2. Is there another algorithm that produces this "fade" effect and does work with omnidirectional lights?

\$\endgroup\$
0
\$\begingroup\$

A mathematically perfect point light that shines in exactly straight rays doesn't cast soft shadows.

Imagine you're a tiny bug crawling along the shadow-receiving surface. From each spot you crawl to, you can either see the point light (and your eye is fully illuminated by it), or you can't (and your eye is fully shadowed).

The light source doesn't have any thickness for it to be partly occluded, or shining at partial strength. That leaves its shadows hard as can be, if we're following the mathematical model strictly (ie. not imitating atmospheric or diffraction effects that could bend a fraction of the light into non-straight rays)

So by setting out to render soft shadows, you're already implicitly stating "I'm going to treat this light like it has some area" so that some spots on the shadow receiver see 50% of the light, and get illuminated to 50% brightness, for instance.

So this:

Can I still use PCSS on omnidirectional lights by "cheating" and applying a tweaked constant value as the light area parameter?

sounds like a valid way to implement that intention.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.