Jump to content

Shadow probleme black bar


Recommended Posts


I think there is a problem with the version 3.2 shadow generator. There is a huge black bar that is larger or smaller depending on the changes we make to shadowMinZ and shadowMaxZ and when we add no mesh with addShadowCaster ()

The second bug is if I add a mesh, the bar is no longer visible, except that it is always present, because if you move a character animate in the alignment of this invisible black bar, it becomes visible.


Thanks in advance

Link to comment
Share on other sites


All of the mentioned points are the result of the computation of the scene extends for the shadows. Basically in PCF several taps are made on the Shadow map to compute the final shadow. 

We prevent with this PR to compute huge extends when no meshes are present solving 1. https://github.com/BabylonJS/Babylon.js/pull/4712

About the second point, I am unfortunately unbable to repro, could you create another PG highlighting the issue ?


Link to comment
Share on other sites

I do not know how to reproduce it, it can be due to a lot of things.

I think it's following the orientation of the camera. But what is strange is that it is very random, it happens for example when I'm on the mesh of my city and more su the field and other times, it is on both.

I try to make a PG, but I do not know what causes it at home, so I do not reproduce anything on the PG.

I do not know how to help you with a useful repro. I should already understand why this is happening, but I do not understand yet.

That's what I have :


Link to comment
Share on other sites

This improves a little bit by putting a big value of 1.0 (100%) of shadowOrthoScale , but it stays there.

Look on the pictures. if I leave by default shadowOrthoScale , I have streaks on the shadow of the character.  depending on the orientation of the character or the camera. IF I turn my character to the right or left, no problem. This only happens on the line of the black bar that we can currently see if we do not add mesh to the shadow generator using this filter only usePercentageCloserFiltering 

On static meshes no problem, maybe it comes from the fact that the character is animate or has bones (which I suppose)


If I increase shadowOrthoScale, there are fewer sorts, but there are still some and I still have the problem, but less present.


Looks like the problem comes from there. Look at the shadow of this video how it works according to stri:

Captured video Webm



Link to comment
Share on other sites

I have to test : exclude of the hemispherical light the sidewalk mesh so that it is only illuminated by both directionals and the problem this product on the ground now.

I do not understand what produces this, but I think there is a little bug with this filter.


Link to comment
Share on other sites

Ok, the bias fix, the shadows are ok. But I still have this shadows extended when I move my character. if I stop it, no problem, but running, I have this:

 If I disable the filter (usePercentageCloserFiltering ), it works well. If I use another filter, no problem either. It's really only with this filter that I get that when I move a character and the camera is in a certain direction.

Left : walk. right: stop

404520455_2018-07-1017_32_48-Greenshot.thumb.jpg.fe37f6f6dd470506534f36462887f0b4.jpg 1439576929_2018-07-1017_32_50-Greenshot.thumb.jpg.cf214da53dfe470815a97daa0021ad31.jpg

I do not have a PG, because I do not know how to reproduce it because I do not know what this problem is. 

With your audit trails, I may end up finding out why and can be doing a useful PG.

Thank you

Link to comment
Share on other sites

Ok, I managed to reproduce on a PG the problem.

Wait for the complete loading of the character, there is for a moment, because there is a file of 20 mo which loads all the animations.

To see the problem move the character in a circle (key Z) and you will see what I see in the image of the post above.


it's been 4 hours that I try to make this PG, it was hard to reproduce it, I was afraid to have to recreate all my play on the playground, which would have been impossible.  it seems to be linked to the fact that the character is animating or because he has bones.

Link to comment
Share on other sites

I know that shadows are complex but we really try hard to provide all tools to make them work.

It is so complex to address all possible cases :(

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.

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...