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

disable sortForAlpha makes objects opaque #12

Open
JirkaDellOro opened this issue Aug 30, 2024 · 1 comment
Open

disable sortForAlpha makes objects opaque #12

JirkaDellOro opened this issue Aug 30, 2024 · 1 comment
Assignees
Labels
discussion question Further information is requested

Comments

@JirkaDellOro
Copy link
Member

Introduced with

Date: Mon Jul 08 2024 15:22:45 GMT+0200 (Central European Summer Time)
disable blending for opaque objects

Is this the desired behaviour? sortForAlpha now means more than what it says...

@JirkaDellOro JirkaDellOro added the question Further information is requested label Aug 30, 2024
@plojo
Copy link
Collaborator

plojo commented Sep 9, 2024

This is the intended behaviour for now.
I made this change to support glTF Alpha Coverage alphaMode: MASK ("The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value". I also added an alphaClip (alpha cutoff value) property to the Material.
With the current sortForAlpha and alphaClip we can support all glTF alphaModes:

  • OPAQUE: sortForAlpha: false; alphaClip: 0
  • MASK: sortForAlpha: false; alphaClip: 0-1
  • BLEND: sortForAlpha: true; alphaClip: 0

However i am not pleased with the current situation:

  • As you stated sortForAlpha now means more than what it says. We need to find fitting names for our properties.
  • alphaClip is a Material property, sortForAlpha is a ComponentMaterial property. This is confusing, both should be properties of the same class. (In both three.js aswell as Unity these options seem to purely belong to a Material)
  • three.js seems to support alpha coverage the same way we do. The corresponding Material properties are named .transparent and .alphaTest. In Unity this is implemented via the RenderingMode-Dropdown. Maybe a dropdown with different options would be easier to understand?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants