robhawkes Posted October 4, 2018 Share Posted October 4, 2018 Hello, I'm trying to get my head around shadows in Babylon and need some help. What I'm trying to achieve is something that gives me high quality shadows throughout an infinite world. Specifically, I'm making a 3D geospatial visualisation using Babylon (think Google Maps but in Babylon) so the user can effectively scroll / move around forever. What I'm struggling with is getting a shadow system set up that can output nice crisp shadows regardless of where the user / camera moves to. What I'm looking for: Single directional light that can dynamically change direction (replicating the sun -- I can solve this separate to this) Crisp shadows on what could be thousands of objects in view (buildings in a city, as seen from above) Shadows are always visible to the user, regardless of where the camera moves to / which new objects come into view Performance I've been digging through the forum and plugging away at it all afternoon and evening and just can't seem to get things working as I want, so I was hoping someone had a better idea that might help. Here's the playground link for what I have so far: https://playground.babylonjs.com/#SX3GXQ#6 What I've tried (amongst many other things): Linking the light position with the camera position Higher resolution shadow map Fiddling with light.shadowFrustumSize Shrinking the scale of the scene What I have currently is sort of what I'm after but the performance is bad (esp. when you zoom out) and the shadows are pixellated and seem to flicker as the camera is rotated. Also, some of the shadows seem to disappear when the camera is rotated too. My understanding of shadows is limited so I'm clearly doing a few things wrong. I'm currently scratching my head at a loss for what to try next so hoping someone can help! Thanks, Robin Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.