Jump to content

Shadows problem


TomaszFurca
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...