satguru Posted April 30, 2016 Share Posted April 30, 2016 see the following playground http://www.babylonjs-playground.com/#2CPMRP#2 This has a ground , 2 boxes and a DirectionalLight The two boxes cast shadow on ground. If you move the two boxes away from each other the shadows cast by them start fading, becomes less sharp. un-comment 13 and comment out 14 to see this effect Is this expected behavior ? (The above does not happen for useVarianceShadowMap) Also is there any documentation on shadowGenerator's properties useVarianceShadowMap, useBlurVarianceShadowMap, usePoissonSampling, bias Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2016 Share Posted April 30, 2016 yep it is (sort of). Babylon.js tries to capture the shadow maps from a point of view where it can embrace both boxes. You can turn this behavior off with light.autoUpdateExtends = false; Regarding shadows documentation: http://doc.babylonjs.com/tutorials/Shadows Quote Link to comment Share on other sites More sharing options...
satguru Posted April 30, 2016 Author Share Posted April 30, 2016 tried "light.autoUpdateExtends = false;". doesn't seem to work http://www.babylonjs-playground.com/#2CPMRP#3 Thanks for the docs. Not sure how I missed those Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2016 Share Posted April 30, 2016 actually it works as it does not update the extend anymore (if the box moves for instance) you can then control the scale of the viewport with shadowOrthoScale: http://www.babylonjs-playground.com/#2CPMRP#4 Quote Link to comment Share on other sites More sharing options...
satguru Posted April 30, 2016 Author Share Posted April 30, 2016 ahh! I see what you mean. So if I set the position of the meshes , set autoUpdateExtends to false and then change the position of one of the mesh then the shadow of the other meshes do not change. Of course the mesh which is moved no longer shows any shadow. can be seen here http://www.babylonjs-playground.com/#2CPMRP#6 clicking the canvas toggles the position of one of the box. un-commenting line 36 shows the effect of autoUpdateExtends shadowOrthoScale also helps Nice, Thanks GameMonetize 1 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.