In-game shadow settings (#9301)

Closes #9301 (closed)

This allows enabling/disabling shadows, enabling/disabling individual shadow types and indoor shadows, changing the shadow map resolution and shadow distance limit in-game. Not the cleanest implementation because see notes. It probably shouldn't actually worsen the performance or affect Android anymore, I think?
It's a start, though. I intentionally avoided exposing the number of shadow maps because that's the most problematic part and that's what wants cleaning up shadow map-related statesets. Ideally, shadow map-related statesets and dummy statesets should be regenerated and pushed separately from the rest of shadow state.

Since this doesn't fully replace the launcher implementation, that's kept around.

Please review the translations. They're mostly lifted from the launcher but I had to add a couple sentences the launcher didn't have. Aside from vibed German, there are no other additions.

Some notes:

  • Unlike akortunov's take from 2020 (PR 2751), this tries to avoid recreating the shadow technique, i.e., it sets used uniforms directly and recreates shadow maps on demand (hopefully I did it in a way that makes sense???). It also sets traversal masks from the rendering manager. Well, it's different in many ways. It also works in interiors.
  • setupShadowSettings sets all settings even if shadows are disabled, to, as mentioned above, make sure we have the shadow map state set for the number of shadow maps enabling shadows will require.
  • It also gets explicit handling for zero distance limit so as to avoid problems with infinite distance not being set in the shadow technique if the distance became finite at some point
  • disableShadowsForStateSet sets the state even if shadows are disabled, ditto. This reverts !205 (merged) but I have this vague impression that MR's concerns don't apply anymore as everything uses shaders.

screenshot440

Some older screenshot comparisons

screenshot407

screenshot406

screenshot405

screenshot404

screenshot403

Edited by Alexei Kotov

Merge request reports

Loading
Loading