Transparent windows in churches

I’m always amazed by the transparent windows in churches that throw the colours onto the floor. Actually, you should be able to do something like this in babylon - I thought: Here I have defined an uneven terrain and the shadow caster. I rotate the light at intervals, and you can clearly see the shadows being cast on the railing when ground1 is activated. Since I put a texture over ground2 the shading doesn’t work. Does anyone have any idea how to fix?

transparent church windows | Babylon.js Playground (babylonjs-playground.com)

The CreateForMesh method is using the opacity and emissive textures, so shadows won’t work with them (shadows are applied on the diffuse texture and the emissive part is added on top). You should simply use the texture as a diffuse texture for the ground:

2 Likes