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

glTF2 use alpha, alpha to coverage and depth prepass #52407

Closed
wants to merge 1 commit into from

Conversation

fire
Copy link
Member

@fire fire commented Sep 5, 2021

0bdbce6

For https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AlphaBlendModeTest cases.

image

image

Fixes the second case of blending from gltf2 test case.

image

image

Fixes hair for the the blend case.

Not fixed in the PR: Alpha being order independent transparency.

@fire fire requested a review from a team as a code owner September 5, 2021 02:38
@fire fire changed the title glTF2 use alpha to coverage instead of depth prepass glTF2 use alpha to coverage and depth prepass Sep 5, 2021
@fire fire force-pushed the gltf-alpha branch 2 times, most recently from c9abc49 to 4b5e8be Compare September 5, 2021 02:43
@fire fire changed the title glTF2 use alpha to coverage and depth prepass glTF2 use alpha, alpha to coverage and depth prepass Sep 5, 2021
@aaronfranke aaronfranke added this to the 4.0 milestone Sep 6, 2021
@fire fire force-pushed the gltf-alpha branch 2 times, most recently from 609e126 to f22af86 Compare September 9, 2021 09:12
material->set_transparency(BaseMaterial3D::TRANSPARENCY_ALPHA_SCISSOR);
material->set_alpha_antialiasing(BaseMaterial3D::ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the best approach. Won't this only work when MSAA is enabled? E.g. when alpha to coverage is available?

Copy link
Member Author

@fire fire Sep 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the originator, it works when msaa is off.

#40364

https://bgolus.medium.com/anti-aliased-alpha-test-the-esoteric-alpha-to-coverage-8b177335ae4f

<Ben Golus> In fact if MSAA is disabled Alpha to Coverage falls back to alpha test. This means it isn’t only useful for VR or other games where you’re guaranteed to have MSAA enabled. Basically there’s rarely a reason to use straight alpha testing ever!

@fire fire marked this pull request as draft September 29, 2021 21:45
@fire
Copy link
Member Author

fire commented Nov 30, 2021

Need to evaluate again after #55084 and #55085

@fire
Copy link
Member Author

fire commented Dec 6, 2021

Closing for now due to need to reevaluate.

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

Successfully merging this pull request may close these issues.

4 participants