Multiple Sun Shadows, is this right?

Hello again, everyone!

I’m really loving the engine so far, but I’ve got a performance question.

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?

Thanks in advance!

1 Like

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 :wink:

2 Likes

Lol:)

1 Like

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.

Thank you!

This is a good idea. Please keep us posted as this is a topic I would like to address one day

1 Like

Are there plans to support Cascaded shadows?
We have similar scene like the one above.

@sebavan
@Deltakosh

we do have the plan. this is on our roadmap but more urgent things happened during 4.0. hopefully we could get it for 4.1:)

Is there any eta for 4.1?
We have to plan the current project.

Thanks

It is for Novemeber 2019
You can see our milestones here:

Thanks in that case we have to find a workaround.

1 Like

What are you trying to achieve? Maybe we can help

Any news on Cascaded Shadows?

This would be so cool. It would be amazing if this gets pushed in the 4.1 release.

pinging @sebavan

Will not be in 4.1 but I would do all I can for the next release !!!

1 Like

Thanks. Would be great to see it in 4.2!

1 Like

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.

I havnt seen anything close to what we try todo.

You just got me curious, what do you guys do? Any demo? It’s cool to look at great things developed with the engine so please share!