I have a room containing some furniture. I am using a directional light as a sun for casting shadows of windows and doors but the light penetrates through walls and falls on every object. Is there a way to avoid penetration of light through walls? I have read and figured out that lights in threejs doesn't follow physical laws but I am just curious.
Asked
Active
Viewed 322 times
1
-
objects have `.castShadow `and `.recieveShadow` properties [you can see documentation here](http://threejs.org/docs/#Reference/Core/Object3D) ...are you making use of them? if so you should provide some more information – Derte Trdelnik Nov 15 '15 at 08:14
-
Even if I set these flags to false then also light is penetrating walls. – Tarun Nov 15 '15 at 13:05
-
ok, can you provide some code / js fiddle ? otherwise it is just guessing - it can be your walls are see-through from one side (not using THREE.DoubleSide) or you use custom shader / material etc... – Derte Trdelnik Nov 15 '15 at 19:20
1 Answers
-2
Sounds like light is scattering off of somethings. Could be bouncing off of things outside the room or things within the room/window frame. There are lights with barn doors for controlling the shape of the light beam. There are flags which allow you to selectively create shadows - similar to barn doors but not directly attached to the light. By limiting how much light is hitting things that reflect too much light you will have more control. If this is just a theatrical setting and not a real room, you could also modify the surfaces of the objects within the room that are facing the light source(s).

HenryM
- 109
- 1
- 4
-
LOL. I thought it was real world lights. That's what I get for wandering around all the stackoverflow sites – HenryM Nov 18 '15 at 00:51