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

Mesh Faces are out of order when Transparency is on #50794

Open
WowieMan opened this issue Jul 24, 2021 · 11 comments
Open

Mesh Faces are out of order when Transparency is on #50794

WowieMan opened this issue Jul 24, 2021 · 11 comments

Comments

@WowieMan
Copy link

Godot version

3.3.2

System information

MacOS 11.3.1, M1, GLES3

Issue description

When the “transparent” flag is turned on in a material and “Cull Mode” is disabled, the meshes faces are out of order.

Screen Shot 2021-07-23 at 9 14 09 PM

Steps to reproduce

Create a mesh and a material, add a texture and set the “Transparent” flag to true, also you will need to set “Cull Mode” to disable.

Minimal reproduction project

BugReport.zip

@Calinou
Copy link
Member

Calinou commented Jul 24, 2021

This is expected due to the limitationd of transparency sorting. As a workaround, use alpha scissor (alpha testing) instead of alpha blending.

#50721 will most likely not fix this because sorting is done on a per-mesh basis, not a per-face basis (which would be too expensive).

@WowieMan
Copy link
Author

When I turn the “transparent“ flag off and turn on alpha scissors, something really odd happens. Is this normal?

IMG_9735

@Calinou
Copy link
Member

Calinou commented Jul 24, 2021

If the depth draw mode is set to Opaque Prepass, this could be due to #36669.

@WowieMan
Copy link
Author

Yep, I have Opaque Pre-Pass is turned on and #36669 looks exactly like what is happening here.

@WowieMan
Copy link
Author

One of the work around in #36669 did work, but sadly the cube’s faces are still out of order.

Screen Shot 2021-07-23 at 11 18 48 PM

@Calinou
Copy link
Member

Calinou commented Jul 24, 2021

One of the work around in #36669 did work, but sadly the cube’s faces are still out of order.

To prevent this starting in 3.4beta, you can render each face with its own MeshInstance using a PlaneMesh or QuadMesh resource. This relies on #50721, so it won't work in 3.3.2.

@WowieMan
Copy link
Author

Oh okay, where can I download the beta, Or do I have to compile it from source?

@Calinou
Copy link
Member

Calinou commented Jul 24, 2021

Oh okay, where can I download the beta, Or do I have to compile it from source?

You have to compile the 3.x branch from source, as there are no beta releases yet.

@WowieMan
Copy link
Author

Okay thanks, I’ll go test that.

@Calinou
Copy link
Member

Calinou commented Oct 18, 2021

@WowieMan Did you manage to get it working in 3.4 beta6?

@WowieMan
Copy link
Author

No, not really. I was able to get  around it by creating two meshes, one for the shadow and one for the  visuals, though that's probably not the best solution long-term.

@Calinou Calinou added the bug label Nov 26, 2021
@Calinou Calinou added this to the 3.5 milestone Nov 26, 2021
@KoBeWi KoBeWi modified the milestones: 3.5, 3.x Apr 23, 2024
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

3 participants