AllForum Posted August 21, 2014 Share Posted August 21, 2014 Hello, I tried to add shadows in a test scene. But the objects do not generate shadows. And if a shadow is drawn it has no sense : it is not generated by a scene object. Here is my light and my shadow generator :var light1 = new BABYLON.DirectionalLight("DirLight", new BABYLON.Vector3(-1, -1, -1), scene);light1.position = new BABYLON.Vector3(2, 3, 2);light1.diffuse = new BABYLON.Color3(1, 1, 1);light1.specular = new BABYLON.Color3(0.6, 0.6, 0.6);light1.intensity = 1.0;var shadowGenerator = new BABYLON.ShadowGenerator(1024, light1);shadowGenerator.useVarianceShadowMap = true;For each mesh :shadowGenerator.getShadowMap().renderList.push(mesh);mesh.receiveShadows = true;My questions :- Is something missing in my code ?- A directional light with a position is unusual : what is the rule to set the position properly ? Thanks for your advices Quote Link to comment Share on other sites More sharing options...
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.