I have this small scene here, which will eventually be quite large since it’s going to be an “arena style” game, and I was trying to figure out how to have each dynamic object have its own dynamic shadow map since they are going to be quite far apart.
The current way I have implemented is to have an identical sun for each dynamic object with “includedMeshesOnly” on the specific object that will be using its shadowGenerator and the ground that it’s casting the shadow on. It’s working great so far, I have the ambient color of the ground set to a negative value to compensate for it being affected by 4 suns/directional lights, but my question is, how much will this negatively affect performance as I scale this up?
Is there a better way to get a shadow map from the sun for each dynamic object in the scene or is this the correct way to do it?
This is currently the best way to do it as we do not support cascaded shadow map that I have on since I started working on Babylon @Deltakosh will most likely kill me for this at some point
Perfect! If it ends up being too performance intensive I’ll probably just program it so that it shares the shadow map with the dynamic objects closest to the player.
I have to mention again. Really good shadows are a must have.
On current projects shadows are a real pain.
Without high quality shadows you cant make a good looking game.
Unfortunately I would have to agree. Shadows give life to projects. However, there are workarounds to still get a good looking game with the current options in BJS.