engine
engine copied to clipboard
Address PCSS softness
After reviewing the PCSS algorithm some more, I came to the conclusion that the reason why directional lights don't get a nice hardening effect is due to the normalization factor, usually the average of the blocker distances, is too large. This makes sense for directional lights seeing as the average blocker distance essentially becomes the distance between the light origin, which for directional lights is indeed very big, and the blocker, resulting in the normalization of receiver/blocker becoming very small indeed.
To fix this, we first need to output depth in linear space, which this PR reimplements for PCSS. Then, we need a normalization factor for directional lights which is right now hard coded to be 3 meters. This factor should be provided as a parameter to the light somehow.
This is the result: