How to add shadows of furniture in room

Hi

this is my sample scene - Babylon.js Playground

I can see the direction light shadows out side the room and that too broken, I am also not able to simulate the shadows in the room using the point light, also I want an effect of sunlight entering the room from the balcony

what am I missing here, any suggestions

regards,
Nipun David

  1. Add a ground on which chair can cast
    shadows
  2. for each loaded mesh add a for loop to add cast shadow and receive shadow on all sub meshes.
1 Like

@HiteshSahu, did what you asked. I enabled shadow on each mesh on the scene

https://playground.babylonjs.com/#3S3L9D#3

There is already a floor on which I have enabled the shadow

@Deltakosh any thoughts?

regards,
Nipun David

In those I would often only use one shadow if needed or in the best case, bake them in the models :slight_smile:

With only one, you could do smthg like this https://playground.babylonjs.com/#3S3L9D#8

Setting the min and max z + bias is mandatory to allow ensure the best possible precision.

1 Like

Hey @sebavan, thanks for the tip.

But I can’t bake shadows as their are movable items in my scene - I am working on a configurator

regards,
Nipun David

@sebavan - hi,

why can’t I get similar result for spot light

https://playground.babylonjs.com/#3S3L9D#9

I have followed this official demo by Babylon for spot light shadows - Babylon.js Playground

Regrads,
Nipun David

You would need a different setup for them due to the dirfferent projection of a spot: https://playground.babylonjs.com/#3S3L9D#10