Jump to content

Several shadows issues


kurhlaa
 Share

Recommended Posts

Hello,

Playing with shadows - https://www.babylonjs-playground.com/#JI41I3

Several issues:

1. Why there are no soft shadows?

2. How do I remove this ugly black square around box/torus on the ground? I've noticed it after switching to the latest babylon.js version. If you comment out the line "shadowGenerator.useBlurExponentialShadowMap = true;" - black square will disappear and shadows will appear, but not soft.

3. If you comment out "shadowGenerator.useBlurExponentialShadowMap = true;" and uncomment "shadowGenerator.usePoissonSampling = true;" - poison shadow appears, but black square still exists;

Link to comment
Share on other sites

What hardware, Kurhlaa?  (Wingnut sets his details-extraction vacuum cleaner to full throttle)  ;)  (We hear some screw-gun insanity, and soon, all we see is Wingnut's feet sticking-out-of Kurhlaa's computer case)  :)

Update:  Ahh... smell this video card.  Smells like tuna, right?  Yep... smuggled from China under the deck-boards of a Chinese tuna boat, to avoid import tariffs.  ;)

Link to comment
Share on other sites

Thx!  Mostly wanted to know if mobile device/desk. 

Any change when switching to slightly older BJS version? 

Anything interesting seen when switching to spotlight or point light?

Any thoughts WHY some of us see the issue, and some of us don't?  hmm.

I should probably shut up and wait for experts to comment.  Sorry.  :)

Link to comment
Share on other sites

I don't see that weird circle shadow either!

So, .useBlurCloseExponentialShadowMap DOES work, setting it up is not easy.
https://www.babylonjs-playground.com/indexstable#IX08ES#5

A good shadow map (from Spector JS, helps a lot!) looks like that attached.

A shadow map depth is encoded in an unsigned int.
depth scaled by shadowGenerator.depthScale (255 means precision is 1/255 unit)
between light.shadowMinZ (nearest point from light) and light.shadowMaxZ (farthest point from light)
bias pushes shadow below surfaces. I dont really understand how to scale it.

blurclose_shadowmap.png

Link to comment
Share on other sites

@Wingnut, probably locally I've mostly used stable version, so didn't noticed this. But now I've found it. At 28 July @Deltakosh made a commit - https://github.com/BabylonJS/Babylon.js/commit/14b644a851a3ae4064d5cf790c22cf0865168997 - after it has appeared this bug with strange square shadow. The previous commit is good.

Idea - please add to the playground an option to choose babylon.js's version more precisely - would be useful in such 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.

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