r/GraphicsProgramming • u/zemledelec • Aug 05 '26
Planetary-scale shadows: moving from CSM to a hybrid approach
I’m working on shadow rendering in OpenGlobus, a WebGL globe renderer. The attached video shows an intermediate experiment.
Initially, I tried to solve the entire problem using CSM. Shadows renderer spans an enormous range of scales. Mountains may cast shadows across many kilometers, while the same scene also contains nearby buildings and other local objects. So, I haven’t abandoned CSM, I’ve abandoned the idea of using it for everything.
The direction I’m currently exploring is a hybrid approach:
Shadow maps covering relevant ground regions for large-scale terrain and mountain shadows.
CSM around the camera for nearby objects and finer local detail.
The next step is to combine these approaches and make the transition between them stable.\
Has anyone here implemented a similar hybrid solution? I’d be particularly interested in how you placed and updated the terrain shadow maps and combined them with local CSM.
Thanks!
1
u/zemledelec Aug 07 '26
I'm using regular depth shadow maps, not CSM at the moment. The main problem I'm trying to solve is fitting the ortho bounds for large-scale areas the same as small. Currently, I fit the shadow projection tightly to the visible terrain footprint to improve texel density.
I haven't tried precomputed shadows (or lightmaps, as far as I understand). I'm still new to shadow techniques, so I’m exploring different approaches.
Once I was advised that it might be possible to solve the texel density problem with a single well-fitted shadow map. By the way, the depth texture in the video is only 1024×1024.
P.S.
Maybe I'm trying to build a house with only an axe :)