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

Vulkan Clustered: BaseMaterial3D Alpha Transparency has no effect on alpha scissor textures, regardless of MSAA level #64501

Closed
Calinou opened this issue Aug 16, 2022 · 4 comments · Fixed by #71261

Comments

@Calinou
Copy link
Member

Calinou commented Aug 16, 2022

Related to #64500.

Godot version

4.0.alpha14 (could be reproduced as early as 4.0.alpha5, but not in 4.0.alpha4)

System information

Fedora 36, GeForce GTX 1080 (NVIDIA 515.57)

Issue description

There is a very subtle effect on alpha hash materials (most noticeably with the Clip blend mode), but alpha scissor materials don't seem to be affected in any way.

This can be reproduced only with the Vulkan Clustered backend. When using Vulkan Mobile, alpha antialiasing works regardless of the MSAA level chosen (although it'll look slightly different depending on MSAA level). Note that alpha-to-coverage isn't expected to work with the OpenGL renderer, as GLES 3.0 doesn't feature an API to enable it.

It's also interesting to note that even when using Vulkan Clustered, alpha-to-coverage seems to have an effect in the 3D material preview in the inspector.

I remember alpha-to-coverage working in Vulkan Clustered back when #40364 was just merged.

cc @marstaik

The images below have been scaled 200% with nearest-neighbor filtering for easier comparison. Click to view at full size.

No MSAA 2× MSAA
2022-08-16_16 42 24_msaa_disabled 2022-08-16_16 42 14_msaa_2x
4× MSAA 8× MSAA
2022-08-16_16 41 32_msaa_4x 2022-08-16_16 42 34_msaa_8x

Steps to reproduce

  • Add a MeshInstance3D with a BoxMesh.
  • Assign a new StandardMaterial3D to the BoxMesh.
  • Set the material's transparency mode to Alpha Scissor, with the alpha antialiasing mode set to Alpha Edge Blend.
  • Add a NoiseTexture as the material's albedo texture, with FastNoise resource and a color ramp that sets its low values to be fully transparent.

Minimal reproduction project

test_alpha_to_coverage.zip

@Calinou
Copy link
Member Author

Calinou commented Aug 17, 2022

I bisected the issue to 30a89b3. cc @Ansraer

MRP used for bisecting: test_alpha_to_coverage_2022-08.zip

@Ansraer
Copy link
Contributor

Ansraer commented Aug 17, 2022

I am still on vacation and dont have access to a gpu right now. Can't think of any reason why my PR would have broken MSAA, so I will have to to investigate more once I am back home.

Just to clarify, this bug only occurs on vulkan clustered outside the editor?

@Ansraer
Copy link
Contributor

Ansraer commented Aug 17, 2022

Yeah, after looking at the screenshots on my phone I can confirm that while MSAA is successfully applied to the geometry edges alpha to coverage (aa on the surface) is obbiously not working. Will need to look into that more when I am on a proper PC.

For future reference AtoC was implemented here: 40364

@Calinou
Copy link
Member Author

Calinou commented Aug 17, 2022

Just to clarify, this bug only occurs on vulkan clustered outside the editor?

The bug occurs in the editor too, but only in Vulkan Clustered.

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

Successfully merging a pull request may close this issue.

2 participants