mirco Posted September 3, 2017 Share Posted September 3, 2017 Hi, i have a question about shadows, is it possible to let a mesh cast shadow on it self? Currently I can make a tree looking like the first picture, but in this case the 3d deep looks not that good. I looking for a solution I can get a tree like the second picture. Thanks for your help Mirco Quote Link to comment Share on other sites More sharing options...
adam Posted September 3, 2017 Share Posted September 3, 2017 https://www.babylonjs-playground.com/#0TG0TB http://doc.babylonjs.com/tutorials/shadows#use-the-best-option-for-self-shadowing Quote Link to comment Share on other sites More sharing options...
mirco Posted September 3, 2017 Author Share Posted September 3, 2017 Hi adam, I tried to adopt my playground to work like your`s. But it looks like I missed something. https://www.babylonjs-playground.com/#16XKTO#36 Quote Link to comment Share on other sites More sharing options...
mirco Posted September 4, 2017 Author Share Posted September 4, 2017 until yet I dont found a solution how I can get shadows on the mesh itself. i have reduced the playground code. https://www.babylonjs-playground.com/#16XKTO#39 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 5, 2017 Share Posted September 5, 2017 For Close shadows you have to precisely position the light and define light.shadowMinZ and shadowMaxZ (lines #34 and #35) https://www.babylonjs-playground.com/#16XKTO#40 Quote Link to comment Share on other sites More sharing options...
mirco Posted September 6, 2017 Author Share Posted September 6, 2017 Thank you Deltakosh for your help. When using BABYLON.DirectionalLight ( whats not really depending on the position because its an infinite light ) with light.shadowMinZ and shadowMaxZ I have to take care of the position to get this beautiful shadows and maybe move the light with the camera. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 6, 2017 Share Posted September 6, 2017 Correct! 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.