Anyone knows a painless way to do dynamic self-shadows from a directional source on a heightmap terrain? I could probably conjure something up but was wondering if there's something already in existence since people love to do terrains a lot.
Terrain self shadowing
Asked Answered
You can look at the shader for steep parallax mapping or parallax occlusion mapping. They can include shadow terms generated from the depth map and should be the same math.
Thanks. Yeah something like that would work. If I remember correctly parallax mapping uses ray marching. It could end up being costly but the similar can be achieved using precomputed horizon maps, with a bit of accuracy loss.
Strange that nobody implemented something like this already. Godot's cascading shadows systems simply falls apart when trying to do terrain shadowing. However if anyone knows a magical setting that makes it look half-decent - I'll buy them a beer 🙂
© 2022 - 2024 — McMap. All rights reserved.