RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.01k stars 175 forks source link

Fixed flickering shadows #2884

Closed tritonas00 closed 2 years ago

tritonas00 commented 2 years ago

Example terrain: https://sim-monsters.com/files/file/3734-orlando-2021/

Before: https://streamable.com/jc4591 After: https://streamable.com/nos1a2 (I don't know why it recorded on fast forward :laughing:)

Also fixes sloppy rendered survey map with shadows: Before: screenshot_2022-03-28_11-54-25_1 After: screenshot_2022-03-28_11-54-41_1

tritonas00 commented 2 years ago

@paroj i go a bit blind here, is this the right way to handle depth fighting issues? Why on windows VS 2019 exposes the issue while VS 2017 doesn't? On linux side, it happens with some gpus (like it happens on my laptop intel 5500 and it doesn't on my desktop intel 4600 gpu)

paroj commented 2 years ago

yes, but it also comes with its own problems: https://docs.microsoft.com/en-us/windows/win32/dxtecharts/common-techniques-to-improve-shadow-depth-maps#peter-panning

tritonas00 commented 2 years ago

It creates this issue https://discord.com/channels/136544456244461568/189904947649708032/958169316526796830

paroj commented 2 years ago

It creates this issue https://discord.com/channels/136544456244461568/189904947649708032/958169316526796830

this is to be expected when you move geometry forward/ back a little.

To be safe, you should only use depth_bias in shadow caster passes and for decals.