mache Posted July 18, 2016 Share Posted July 18, 2016 Hello, I am trying to generate shadows for a 3D scene with the ShadowGenerator of Babylon. My problem is the following : a mesh can't create shadows and receiving shadows at the same time. Here is a playground where this is illustrated : http://playground.babylonjs.com/#1R4XE8#1 Let's focus on lines 47 & 48 : torus.receiveShadows = true; shadowGenerator.getShadowMap().renderList.push(torus); If the first one is commented the torus doesn't receive shadow and when it pass into the cube shadow, it is still highlight. If the second one is commented the torus doesn't create shadow but when it pass into the cube shadow, it act well. Finally if the both are uncommented the torus is constantly shadowed (like it is occluding by itself...) Thanks for any help ! Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 18, 2016 Share Posted July 18, 2016 Self Shadow only works fine with none VSM shadow generators: http://www.babylonjs-playground.com/#1R4XE8#2 mache 1 Quote Link to comment Share on other sites More sharing options...
mache Posted July 18, 2016 Author Share Posted July 18, 2016 Nice it's working, but shadows quality is less good. Thanks a lot Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 18, 2016 Share Posted July 18, 2016 PCF is still available if you prefer. http://www.babylonjs-playground.com/#1R4XE8#3 Quote Link to comment Share on other sites More sharing options...
mache Posted July 18, 2016 Author Share Posted July 18, 2016 Contour are more smooth, but some thin meshes are not detected (such as cubes at the bottom right or spheres on the floor). I'll try to scale my scene bigger. Thanks again. Quote Link to comment Share on other sites More sharing options...
mache Posted July 18, 2016 Author Share Posted July 18, 2016 I scaled by 5 my scene and it's fitting my needs ! Sebavan 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.