excelsior Posted May 16, 2016 Share Posted May 16, 2016 Well another easy question i'm sure but how can i delete a light from my scene ? Let's say i ve got one light on and i want to turn another one on but turn the first one off because i don't want to render the shadow of two light how could i proceed ? if a light is at intensity 0 doe the engine still calcul shadow like if it was lit ? Quote Link to comment Share on other sites More sharing options...
Samuel Girardin Posted May 16, 2016 Share Posted May 16, 2016 Hi, Just use your_light.dispose() ; Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 16, 2016 Share Posted May 16, 2016 @excelsior It depends, you said you have two lights and want to turn light1 off and light2 on, are you planning on turning light1 on again later? if not, then removing it (dispose as samuel answered) is probably best, if yes, setting the intensity to 0 should stop it from casting shadows. take a look at this PG, click on scene with mouse to turn on/off lights. PG: http://www.babylonjs-playground.com/#PR3YQ#2 Quote Link to comment Share on other sites More sharing options...
adam Posted May 16, 2016 Share Posted May 16, 2016 You could also use scene.removeLight: http://www.babylonjs-playground.com/#PR3YQ#3 Quote Link to comment Share on other sites More sharing options...
excelsior Posted May 16, 2016 Author Share Posted May 16, 2016 ok that simple thx 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.