Darcey Posted August 17, 2016 Share Posted August 17, 2016 Hi, I was doing some tests with BabylonJS and while checking out the lights I found that the spotlight goes through some objects but not others? Is this a bug of babylonjs or something I've done? Example can be seen here, the spotlight hits the top cube/box/rectangle and passes through to the floor and smaller cubes/boxes/rectrangles.http://dev.aftc.co.uk/WebGL/BabylonJS/06_Lights2 Ideas? Thanks D Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 18, 2016 Share Posted August 18, 2016 Hi @Darcey, welcome to the BabylonJS forum... good to have you with us. Nice looking scene... I like it. Actually, spotlight beams travel through everything... unless... they hit a mesh which has been included in the renderlist of a shadowGenerator assigned to THAT light. At least I think that is correct. I believe the same is true for two other types of lights which can produce shadows... the pointLight and the directionalLight. I don't think the hemisphericLight (often aimed 0, 1, 0 - to the sky, reflecting highly-dispersed/refracted light-rays from the atmosphere) can produce shadows at all. I'll give you some time to ponder that, and experiment if you like. Holler if you have more questions. And again, welcome! PS: Just in case you are curious about the maximum number of lights that a single material can handle, it defaults at 4, but you can set material.maxSimultaneousLights to higher numbers... and stretch those limits a bit. http://playground.babylonjs.com/#BIVOB#8 (see lines 24/25) Fun! Some FPS slowing seen, though. GameMonetize and oschakravarthi 1 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted August 18, 2016 Share Posted August 18, 2016 @Darcey It appears only to be your light3 causing this issue, Try adding your flying plate to light3's "includedOnlyMeshes" PG: http://www.babylonjs-playground.com/#1FUKMR#1 //If you comment out line 35, "light.includedOnlyMeshes = [sphere];" the spotlight will also hit the ground Wingnut 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted August 18, 2016 Share Posted August 18, 2016 nice scene anyway :-) just a personal advice : use instances or SPS (solid particle system) instead of so many occurences of a BJS box and the perfs will be far more better Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 19, 2016 Share Posted August 19, 2016 http://www.html5gamedevs.com/topic/15631-self-shadowing-1-mesh-with-submeshes/ http://www.babylonjs-playground.com/#1FUKMR#2 Quote Link to comment Share on other sites More sharing options...
oschakravarthi Posted April 9, 2019 Share Posted April 9, 2019 On 8/18/2016 at 11:58 PM, Wingnut said: Hi @Darcey, welcome to the BabylonJS forum... good to have you with us. Nice looking scene... I like it. Actually, spotlight beams travel through everything... unless... they hit a mesh which has been included in the renderlist of a shadowGenerator assigned to THAT light. At least I think that is correct. I believe the same is true for two other types of lights which can produce shadows... the pointLight and the directionalLight. I don't think the hemisphericLight (often aimed 0, 1, 0 - to the sky, reflecting highly-dispersed/refracted light-rays from the atmosphere) can produce shadows at all. I'll give you some time to ponder that, and experiment if you like. Holler if you have more questions. And again, welcome! PS: Just in case you are curious about the maximum number of lights that a single material can handle, it defaults at 4, but you can set material.maxSimultaneousLights to higher numbers... and stretch those limits a bit. http://playground.babylonjs.com/#BIVOB#8 (see lines 24/25) Fun! Some FPS slowing seen, though. Hi, I am facing the same problem here. I have designed an apartment with 6 rooms. Light is going thru walls from 1st room to 6th room ? This is not the behavior of light in reality. It should stop at walls onless 1. The wall is set to be transparent. 2. If there are any windows of doors to that walls. How can I make the light stop at walls?. I could not understand the renderList stuff. Do I need to mention all my mesh IDs in the renderList of every light? I have 100s of meshes and I have around 10 lights in every room. 50, 60*100=6000 GUIDs in file. Please help me. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 14, 2019 Share Posted June 14, 2019 We have a new forum: forum.babylonjs.com 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.