TomaszFurca Posted October 13, 2018 Share Posted October 13, 2018 I have two types of shadow generator. For static elements and for dynamic. I have problem with shadow generator for dynamic meshes. At the begging of the scene i cannot see my light and shadows instead that I see artifacts, but when i go to specific point in scene everything start working correctly. I attach video to show it in example. https://streamable.com/ayukz Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2018 Share Posted October 15, 2018 How do you create the light for dynamic objects? Is it set to not auto extends? (http://doc.babylonjs.com/babylon101/shadows#directional-lights) Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted October 15, 2018 Author Share Posted October 15, 2018 This is spot light generated using this code: const playerLight = new BABYLON.SpotLight("playerLightSpot", new BABYLON.Vector3(0, 45, 0), new BABYLON.Vector3(0, -1, 0), null, null, scene); playerLight.diffuse = new BABYLON.Color3(1, 0.7, 0.3); playerLight.angle = 0.7; playerLight.exponent = 70; playerLight.intensity = 0.8; playerLight.parent = playerMesh; And then after recive information from socket about monsters I add it using: dynamicShadowGenerator.getShadowMap().renderList.push(mesh); If I use only player shadow then shadow is OK. But when i add monsters then i saw bugged shadow and light like this in video. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2018 Share Posted October 15, 2018 Yes so try with autoExtends = false. This should help Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted October 16, 2018 Author Share Posted October 16, 2018 Unfortunately this doesn't help with resolve this problem. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 16, 2018 Share Posted October 16, 2018 I may need a SIMPLE repro to help (I guess you are getting used to that ;)) 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.