Lighting question

Hi again :smiley:

I have a question about lighting. I have issue with light visible behind the wall . I don’t want to it be visible behind the wall. Should I use in blender light-map ?

That’s probably the best option if light is not moving

1 Like

So the lighting issue was not a problem :smiley: Problem is now with a shadows and point lighting.

I have two sectors : S1, S2. Why is like that ? It is because I wanna make feeling of that: If player will open the door from S1 to S2 then lights in S2 will turn on slowly, If doors will be closed then light in Sector will turn off according to where is the player in S1 or S2 .

now the problem :

On this picture you can see the S1, S2 and position of the point light.
S1 is has activated getshadowMap and receiveShadows.
S2 it has only receiveShadows.
door with wall is separated objs. but has activated getshadowMap and receiveShadows.
I have there set there :
shadowGenerator.usePoissonSampling = true;

If I don’t use the shadowGenerator.setDarkness(0.5); everything in S1 is black.

and i use lot of things what I found like :

But nothing helped me. So what Am I doing wrong ?

Thank you in advance for answers :slight_smile:


Well as this depends a lot from your scene we will need a repro in the PG to help unfortunately

ok its no problem. But, how can i put obj.babylon in the playground?
I am noob at this :smiley:
thank you :slight_smile:

Ok I got it. Some how I did it :smiley: at least I learned new things :wink:
so here is my example :

if you zoom closer you can see the shadows but very lightly and only at specific place .

Hello! from what I’m seeing you have a self shadoing issue: ie. your room is casting shadows on itself which will require a highly precise shadow maps.
You can play a bit with light.shadowMinZ and MaxZ (or with generator.bias)

Unfortunately, as stated here, there is not much you can do about it. The best you can do should be to avoid self-shadowing

Check the troubleshooting doc here: Shadows - Babylon.js Documentation