Open atirut-w opened 2 years ago
Related/Duplicate: #60391
This seems related indeed, but might not be a duplicate. The models I used from the archive are heavily tessellated.
I just downloaded the scene myself, and yes that boat is very well tessellated. Definitely related though.
Either way this issue can be reigned in by increasing Pancake Size:
Playing with the Pancake Size slider has interesting results. Increasing it causes the penumbra to apparently turn itself inside out:
Here's another repro project that you can use to see this in action: Bistro-Demo-Tweaked/PCSS-test
I've found lower camera FOVs exacerbate the issue.
Turning up Pancake Size by even just a little bit helps the issue immensely, so the "fix" may be as simple as setting the pancake size higher by default, and adding some documentation recommending to increase pancake size the lower the FOV of your game camera is. I've found Pancake Size 30 matches well with FOV 75, for example. 🤔
Not sure if this is the right place to put my thoughts in, but I think this should be higher priority considering how this bug will affect scenes with huge shadow casters. This could become a problem in open world games.
I tested the Bistro scene above and this issue is not related to only large objects, small objects have the same issue.
Also for some reason 0 valu to the angular distance has a significant influence on shadow bias (although for some reason at this point pretty much any shadow setting has a significant negative impact on the shadow bias, was this intended or are some steps applied in some strange order perhaps?).
Here are two images with default settings:
1/ Angular distance = 0
2/ Angular distance = 0.01 (the lowest value possible in the editor)
I'm not sure if this is related to this issue or not so I'm mentioning it as extra.
Angular distance > 0 also causes increasingly blurred shadows as the camera moves further from the origin where abs(dot(light_direction, camera_pos)) > 0
. I see shadows steadily transition from crisp to incredibly blurry over a distance of several thousand units.
Could detecting if the penumbra is "inside out" help fix this issue? I feel like that's the right direction since the issue seems to stem from the shadow being so far away from the caster that it intersects with itself from the other side:
Godot version
v4.0.alpha12.official [2c11e6d9e]
System information
Fedora Linux 36 (Workstation Edition), Vulkan Clustered, GTX 1660
Issue description
When soft shadows are being cast by objects that are thin and have lots of distance, they seem to break.
Tested with House and Rungholt mesh from McGuire CG Archive.
https://user-images.githubusercontent.com/25323231/181693286-1eadffa1-d775-455c-a86a-885315d7a620.mp4
Also with a simple stretched cube
https://user-images.githubusercontent.com/25323231/181693586-45b2e42e-d69d-42f1-ba2e-0e8057400122.mp4
Steps to reproduce
Minimal reproduction project
No response