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

Issues with alphamap #22321

Closed
WilliamLiu-1997 opened this issue Aug 13, 2021 · 3 comments
Closed

Issues with alphamap #22321

WilliamLiu-1997 opened this issue Aug 13, 2021 · 3 comments

Comments

@WilliamLiu-1997
Copy link

Set alphamap will make transparent material behind invisible

In the screenshot, an aphamap is applied on the pink patch and set the transparent = true. The blue patch also set transparent = true. It can be seen that the part of the blue patch that behind the pink patch is invisible. If the transparent = false (like purple patch), everything is fine.

Screenshots

image

Platform:

  • Device: [Desktop]
  • OS: [Windows]
  • Browser: [Chrome]
  • Three.js version: [dev]
@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 13, 2021

Can you please share a screenshot of the expected result? A editable live example demonstrating the issue would be even more helpful.

@WilliamLiu-1997
Copy link
Author

Yeah, and I just found that it seems to be an issue on transparent and opacity, not only on alphaMap.
image
And I just made a live example here: https://rawcdn.githack.com/WilliamLiu-1997/three.js/ef74e4830e7dd15653da8df7065b3dec779bf4ca/examples/alphamap_issue.html
In the demo, when you set all the material to be transparent=true and opacity <1, and look from the bottom of the plane, you can see some of the cylinders will disappear.
Thanks.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 13, 2021

This is in fact a know issue of how transparent objects are rendered in three.js. It's a matter of render order, sorting and depth testing.

I suggest you search in the forum for workarounds. This was already often discussed e.g. in https://discourse.threejs.org/t/multiple-transparent-materials-rendering-issue/3599.

I suggest to mark this issue as a duplicate of #9977.

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

No branches or pull requests

2 participants