DirectionalLight3D’s ‘blend splits’ option has a noticeable performance cost #9811
Replies: 1 comment
-
Since Godot 4.3, blend splitting is performed over a smaller distance, which allows it to run a bit faster: godotengine/godot#82668 This isn't finalized for the Compatibility rendering method yet, but either way, performance could be further increased by adjusting mesh culling to work with the new shadow splits distance when Blend Splits is enabled. This will particularly help with CPU bottlenecks by reducing draw call count.
Yes, all game engines have some kind of overhead when blend splitting is enabled, as you need to draw more objects in several shadow passes. This results in an increased draw call count and more vertices per shadow pass. On top of that, the area where splits are blended needs to have shadow maps sampled twice (instead of just once). There are many ways to reduce this cost (such as using a smaller blend split distance or using dithering to sample shadows only once per pixel), but it can't be completely eliminated. If you want to minimize draw call count at the cost of higher GPU usage, use the Orthogonal shadow mode with a higher directional shadow resolution to compensate. This also eliminates visible split transitions entirely, as the entire directional shadow will be performed in a single pass with consistent level of detail.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm already aware that you guys know of the issue (it's in the option tooltip), but DirectionalLight3D's 'blend splits' option has a noticeable performance cost for me.
I understand that you can't get anything for free, but even on my school's computers (which are working a 3060) whenever I look down in-game, the game's performance drops noticeably. Turning it off fixes this stuttering, but it makes for jarring blend split transitions. (I'm using PSSM4 and I want my game's sun shadows to be reasonably detailed).
The reason I'm submitting this is to ask you a few questions:
Calinou has a PR that used dithering to blend between the shadow splits, but I can't remember which one it was while I was typing this out.
In any case, I hope the performance cost can be reduced enough for me to turn it back on, and I wish you the best of luck.
Beta Was this translation helpful? Give feedback.
All reactions