Godot Version
4.2.2.stable
Question
Howdy friends! I’m trying to find out how to layer Sprite3Ds and plane meshes in a 3D environment. What I want is for the sprites facing Z (parallel to the camera) to stick through the sprites facing Y (perpendicular to the camera, flat like a rug), as seen in the image below
As you can see here, mario’s head is sticking out through this field of flowers. You can also see the leaves beneath the petals. When I tried recreating this, I encountered a layering issue:
Here you can see the Z-oriented sprites rendering directly on top of the Y-oriented flower field sprite. When I walk past a certain distance, the flower field sprite then renders on top of everything else.
What’s the proper way to address this? Thank you for your help!
I think what you want is clipping. So I would try putting the 3d sprites in the same render index and just physically place them where they should exist.
2 Likes
That is what I want, but I’m not sure to how achieve that. Is render index the same thing as render priority? They are all set to 0 because they haven’t been changed from the default.
1 Like
You may need to enable alpha-cut, the transparent sorting may be the issue?
2 Likes
@gertkeno is right. Adjust the transparency option or alpha cut option under flags in the sprite3d. it will fix your issue.
I did some local tests and found if you change at least one sprite’s apha/transparency options it will start behaving correctly.
1 Like
Thanks! Changing the alpha cut option worked for me, the sprites now cut through eachother instead of cover eachother. I’m still trying to figure out how to make it work for plane meshes but for 3D sprites it works great