Nakul SOlanki Posted December 2, 2016 Share Posted December 2, 2016 Hi, I am trying to create a new interface for my home automation project. The Idea is to have a 3d model of the house and show the status of the actual lights by highlighting virtual lights in the 3d house. Later this can be used to highlight floors whenever a motion sensor for a room is triggered. For this I created a scene in blender. The scene has two point lights and one hemi light and i use the BABYLON.ScreenLoader to load the entire scene. It looks like this when the lights are on And like this when the lights are off. The problem is that even though the walls are opaque, when the light is on it passes through the walls. I have highlighted the area with Red rectangles. Any idea, why this is happening? or what should i do differently to avoid this? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 2, 2016 Share Posted December 2, 2016 Hello, you are looking for light occlusions and unfortunately this is not supported Do you plan to move your lights dynamically? If no, I highly recommend using lightmaps Quote Link to comment Share on other sites More sharing options...
Nakul SOlanki Posted December 2, 2016 Author Share Posted December 2, 2016 Thanks for the quick response. No I do not plan to move the lights dynamically. I will try lightmaps. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted December 2, 2016 Share Posted December 2, 2016 @Nakul SOlanki Hi - and welcome to the forum Here is a solution that I use - see image below. The scene as you see it shows a house layout which has multiple rooms - in fact in the complete model 9 rooms and 10 lights but for ease of explanation I have hidden some of the interior. So an explanation. the layout has an outside wall (red) in its own layer. The inside wall for each room each have their own layer (Room1-Room8 in the Layer manager) . You can add any furniture for each room into the appropriate layer. Now each room has a light in the same layer (Room 8 is chosen and its light in the image). Now for each light before export I check the box "This Layer Only" . Each light then only illuminates the meshes in its layer - the inside wall and furniture. The "Range" of the light can also limit illumination. It works quite well. If you need more info just ask. It is better than baking out lightmaps as you might change a room's content which would involve baking a new lightmap. cheers, gryff adam 1 Quote Link to comment Share on other sites More sharing options...
Nakul SOlanki Posted December 3, 2016 Author Share Posted December 3, 2016 Thanks for the response gryff. I link this approach better as I will not have to regenerate light maps if i add new furniture to any room. I tried the "This Layer Only" approach but I was not able to make it work. Reducing the distance and marking the Sphere checkbox seems to reduce the effect of light but it still treats walls as transparent. If i render the scene in Blender it renders as expected i.e. light from one layer doesn't cross over to the other layer, but when i export the whole scene to BABYLON the light crosses layers. In your example above do you export each item individually or do you export the whole scene? Blender: BABYLON: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.