Could the technique in this video be used to kill shadow acne in threejs?

The technique is described in this video at the timestamp + 5 seconds, but I don’t know if this could apply to threejs PCSSoftShadows… but it sounds plausible?

any giant graphics brains here care to chime in?

Here’s the video:

https://youtu.be/jusWW2pPnA0?si=5C_55p-tetC5xv2Z&t=1001

4 Likes

What technique are you using that gets you shadow acne? In this case he is fixing an issue with raymarching/casting

He states the technique is a less-of-two function. It compares two samples on a distributed curve. He claims he doesn’t understand it but it works. Personally, it reminded me of early GLQuake… which had weird shadows under any open-faced staircase. Similarly, in the new Indiana Jones game, lily pads clip right through the a canoe.

1 Like

My read of it, is that it’s classical PCFShadowmapping but instead of a single test of shadowmap depth, he does 2 tests…

One with the regular shadowmap depth sampled with NearestFilter, (like how it works in THREEJS) and a second test with LinearFilter (which isn’t normally supposed to yield meaningful data because interpolating depth values doesn’t make much sense)… but by taking the least of the 2 values, it somehow fixes shadow acne?
Shadow acne is always such a weird thing to accommodate and .bias feels so arbitrary…

1 Like