Jump to content

Shadows slightly too small


Venerated1
 Share

Recommended Posts

http://playground.babylonjs.com/#1NE321#1

Maybe this isn't even a bug but a setting that I'm too newb to figure out... but the shadow distorts pretty bad on smaller spheres.

When you make the sphere bigger, it look beautiful. Like this:  http://playground.babylonjs.com/#1NE321#2

Is this indeed a bug? Or, is this a setting that I can dynamically change? Or, is it just a limitation that I should just be patient on?

Link to comment
Share on other sites

http://playground.babylonjs.com/#1NE321#4

So, I held back my frustration with the fact that distance didn't make any noticeable difference and dug through the troubleshooting guide.

SUCCESS!!!! But, I would strongly recommend an edit to the troubleshooting guide. 

Quote

Bias

You may want to reduce shadow acne resulting from not precise enough shadow map. To do so, you can define the bias (which is 0.00005 by default).:


shadowGenerator.bias = 0.01;

Shadow generators compare the depth of every pixel with the depth of occluders (shadow casters) seen from the light point of view. As we are dealing with low precision textures (when supported Babylon.js will use float textures but low end devices only support int textures), you may want to boost the depth of occluders to facilitate self shadowing (An object casting shadows on itself).

Possibly add this:

Quote

Bias can also sometimes shrink or distort a shadow. In these cases, reducing the bias can occasionally produce a better effect.

shadowGenerator.bias =0.000009;

I don't know why everything I'm writing is bold now... but you get the point. I'm just happy that I have a fix. :D

 

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