Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example - webgl_shadow_contact artifacts #20848

Closed
Fluqz opened this issue Dec 7, 2020 · 3 comments · Fixed by #20849
Closed

Example - webgl_shadow_contact artifacts #20848

Fluqz opened this issue Dec 7, 2020 · 3 comments · Fixed by #20849
Labels

Comments

@Fluqz
Copy link
Contributor

Fluqz commented Dec 7, 2020

Describe the bug

The contact shadow example from @marcofugaro, when viewed from further away or with increased plane size, starts to flimmer and get distorted shadows.

To Reproduce

Basicly just dolly out far enough in the example.
I made a live example which shows it better.

https://jsfiddle.net/h0jmwvpd/2/

Expected behavior

The shadows should stay static. No artifacts, no flimmering.

Platform:

  • Device: Desktop
  • OS: Windows, MacOS
  • Browser: Chrome
  • Three.js version: r123
@Mugen87 Mugen87 added the Addons label Dec 7, 2020
@gkjohnson
Copy link
Collaborator

It looks like a depth precision issue because two planes are added on top of eachother with a small offset:

fillPlane.position.y -= 0.00001;

I think using polygonOffset should fix this.

@Fluqz
Copy link
Contributor Author

Fluqz commented Dec 7, 2020

Yep, that worked! Thanks
I can make a PR to update the example if you want

@gkjohnson
Copy link
Collaborator

@Fluqz That would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants