Jump to content

Babylon dynamic shadows FLICKERING when there is many moving objects in scene

Recommended Posts

Hi,, I have problem with shadowmaps


when there are objects moving around scene origin 0,0,0 shadows starts flickering very intensive


how can i solve that ? "it is iimposible to take screenshot of that"




Also is there possible to merge two shadowmaps ? for example I have want to use two ShadowGenerators


fist for static objects with refresh rate: 60

second with dynamic objects refresh rate: 1


it works very well in term of performance but problem is that when first static shadowmap is overlapping dynamic ,,, shadows become darker at overlapping point.


Link to post
Share on other sites

Same problem for me.. I have a lot of objects moving at the same time, and even when they all stop, the shadows all move for no reason



It seems this happens because the shadow map seems to "stretch" based on the objects. Try it yourself: start all the objects from 0,0,0 to a random point in a range of like 400, 400 and you will notice the shadows being more pixelated.

Link to post
Share on other sites

I don't think it's the bias. It's that the shadow map gets calculated for both sphere and then gets frozen. So the size of the shadow map had to be expanded before freezing it. With a fixed resolution it sooner or later (depending on the area it has to cover) ends up like you see it in playground #3. You could set a little timeout to let the shadow generator do it's job and then add the sphere after that: http://www.babylonjs-playground.com/#XACM2#5 Then the shadow map is only calculated for the first sphere, covers only the area of the first sphere and doesn't change when you add the other one a little bit delayed.


.... assuming I understood that correctly. If not, somebody let me know :D


Another alternative might be a second shadow generator..one for each sphere.

Link to post
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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...