I tried a lot
https://www.babylonjs-playground.com/#164IC3#2
for(var i =0; i < 100;i++){
change to
for(var i =0; i < 10;i++){
- The shadows are getting better
I tried a lot
https://www.babylonjs-playground.com/#164IC3#2
for(var i =0; i < 100;i++){
change to
for(var i =0; i < 10;i++){
Hello and welcome!
The problem you are facing is due to the fact that your shadow map will lose a lot of precision to make sure it can embrace the entire scene.
Ideally we should have cascaded shadow maps to help with your case (wink wink @sebavan) but we do not support this feature yet.
So the idea is to keep in the shadow map only the meshes close to the camera. In any way this will be far better from a performance standpoint
Does the light move? Because if it does not move it could be worth baking the shadows into a texture so you can have the best rendering
But DK… with baked-into-ground-texture building-shadows… user-carried flashlights/torches… cannot illuminate shadowed areas. (small price to pay, for huge added performance of baked shadows… I know)
I think user will ALSO lose building shadows on OTHER buildings… with baked shadows on ground.
(Wingy prices supercomputers)
Yes I agree. If the op needs a dynamic shadow then we need to decouple the mesh into multiple meshes (like block by block for instance)
Yeah, essentially you are saying… “Don’t let the camera do such a WIDE view”. Keep things close-in… as much as possible, and do render-only-what’s-needed wisdom. nod. Tiling ops.
City is currently single mesh, huh? Interesting.
Is there a good way to separate the mesh?