-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Transparent object with no culling creates visual artifacts #97895
Comments
This is a limitation of how transparency works. Transparent meshes are sorted then drawn by their distance from the camera, but within each mesh, faces are drawn in an arbitrary order, not sorted. So you can't guarantee that the faces on the far side of the mesh will be drawn before the faces on the close side of the mesh. I believe it's based on the order of the vertices/faces in the mesh's arrays, but I haven't looked at the actual implementation. You can reproduce this entirely within Godot, too, with a standard sphere mesh: Godot_v4.3-stable_win64_XFQnAsfNYb.mp4(Also, your MRP did not actually have |
@tetrapod00 Thanks for the response. I updated the MRP. |
The best workaround depends on why you need culling disabled. Two meshes, one with frontface and one with backface culling doesn't sound that unreasonable. I think in some cases you can also use a custom shader with Github issues aren't the right place for support questions, so I'd recommend one of the community channels if you're looking for in-depth help with this problem. |
@tetrapod00 ok thank you |
@tetrapod00 I'm tempted to reopen this issue. The goal here is to create a semi-transparent capsule. It seems like the only possible solution is to create two meshes; one with See a similar unanswered forum question from February and a lengthy discussion in Godot Cafe |
I think as is, this isn't a bug, but a limitation/missing feature. So I'd recommend opening a proposal for a feature addition of some kind. There are some existing proposals that are aiming to address similar problems. I think godotengine/godot-proposals#4825 is the closest, but see also godotengine/godot-proposals#7916, godotengine/godot-proposals#7870, godotengine/godot-proposals#496. |
Actually, I managed to figure it out. I just needed to change the |
Tested versions
System information
Windows 10 - Godot v 4.3.stable - Compatibility - NVIDIA GeForce RTX 3060, Driver version: 31.0.15.3734
Issue description
Description
An smooth-shaded icosphere with transparency enabled, blend mode mix, and culling disabled will create strange visual artifacts.
I expect this to look like a smooth capsule, but instead I see the jagged tris highlighted with weird shading.
Steps to reproduce
.glb
fileMeshInstance3D
.Minimal reproduction project (MRP)
transparencyartifacts.zip
The text was updated successfully, but these errors were encountered: