mache Posted August 31, 2016 Share Posted August 31, 2016 Hello, I am having trouble with the shadow generator, this playground illustrate my problem => http://www.babylonjs-playground.com/#DAKLR#4 I made a room with a window. Then I add two lights with a shadowgenerator for each one, the two sphere show their position into the scene. The one outside the room act properly (you can see light pass through the window), but the one inside the room light nothing. If you comment line 97 -> 104 (remove the roof) the light inside act properly. Thanks Quote Link to comment Share on other sites More sharing options...
jellix Posted August 31, 2016 Share Posted August 31, 2016 Both lights are directional lights so you cannot say that one light is inside the room. So everything works correct. Sebavan and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 31, 2016 Share Posted August 31, 2016 Hi guys! To expand on that notion... http://www.babylonjs-playground.com/#DAKLR#5 I am moving/animating the directional light1 .position... to see WHY directionalLights even have a .position property. What is it used for? I needed to do tests. (curiosity, ya know?) As you can see, moving dirLight 1 far away, DOES do things. Shadow edges get distorted, lighting gets dimmer, etc. Not sure why. Line 130... I experimented with light1.range... no affect seen. hmm. Switching usePoissonSampling to false... does even more fun things. I HAVE heard that certain types of sampling... don't work well at great distances (like the distance to the Sun) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 31, 2016 Share Posted August 31, 2016 By default directionlight's position is used to define where the virtual camera used to render shadow maps should be positioned. Since bjs 2.3, this position is automatically computed by Babylon.js (it takes the closer position where all the scene can be seen). But as always, you can also consider doing it by yourself. mache and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
mache Posted September 1, 2016 Author Share Posted September 1, 2016 Helo guys, Thanks for your reply @jellix Directional light in babylon.js are using shadow mapping so as said Deltakosh it's possible to define a position. Nevertheless I am still a beginner in 3D, the directional light don't seem to be the right choice. What would be an adapted indoor light to fit a scene such as my playground? @Wingnut Yeah I also notice some fun things with the sampling : @Deltakosh Ok I'll give a try to see what can I get. 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.