Multiplicative Shadows


I’ve got the following situation. I have a scene that is basically modeled from real images including real image textures and we really want to keep this realistic look. Now I would need a shadow for some of the objects (some already include one). The problem is that I cannot really add light sources and do traditional lighting and shadowing since this would interfere with the already “baked in” lighting of the real images.
So all I would need is the actual shadow without making the scene anyhow brighter. Or in other words a multiplicative instead of a additive shadow. I know that I can write a custom shader and access the shadow depth textures to do the shadowing there but this would only be the fallback solution.

Option #2 would be to disable all view dependent lighting effects and make the whole scene darker. Then we can add light sources and do traditional shadowing/lighting of non-shadowed areas.

Is there a way to achieve this kind of effect with babylonjs and its built-in methods?

Thx already in advance! :slight_smile:

Maybe ShadowOnly Material | Babylon.js Documentation can help, or the excludedMeshes / includedOnlyMeshes arrays of a light (Introduction To Lights | Babylon.js Documentation).

Else, I think you will need to do some custom shader code.

1 Like