Jump to content

Spot light passing through objects


Darcey
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 years later...
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.

  

Link to comment
Share on other sites

  • 2 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...