Improper Rendering of ArrayMeshes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ErikSell

Hi, I’m generating an ArrayMesh with 24 surfaces. It’s supposed to look sorta like a brewing stand in Minecraft. But when I tried it out, it looked like this.
The stem is rendering behind the bases, instead of between them. Why?

Either your model is wrong, or the material is wrong and is not getting sorted properly (is it opaque?).
But when you say “24 surfaces”… you mean 24 polys? Because a mesh like this really doesn’t need 24 surfaces. In Godot surfaces are meant to be for parts of the mesh having different materials.

Zylann | 2019-12-20 13:45

No, 1 poly with 24 surfaces. I think they’re being drawn in index order, really. There’s one material for each surface, and they’re all transparency enabled. I know how Godot surfaces work. The model is fine, I’m constructing it at runtime from a minecraft resource pack. I will look at the transparency issue.

ErikSell | 2019-12-20 18:20

No, 1 poly with 24 surfaces

There’s one material for each surface

Sorry I’m confused now… there is no way to have 24 materials if you only have one surface…

they’re all transparency enabled

This may be what causes the rendering issue. Besides, your model doesn’t show transparency, you could have used an opaque material. In Minecraft, that’s what happens. If pixels are transparent, they are actually discarded with alpha scissor.

Zylann | 2019-12-20 18:39

Thank you, that should do it.

ErikSell | 2019-12-21 02:02

Thank you, removing the transparency did the trick.

ErikSell | 2019-12-21 15:18