2D Sprites z-fighting in 3D Environment

Godot Version



I have a 3d environment set up with a few 2d sprites placed perpendicular to each other. Within the 3d environment I also have a Camera3D as a child of a CharacterBody3D. When the camera is close to the perpendicular sprites they behave normally with the vertical sprite rendering on top of the horizontal one. However, if the camera moves too far to either side of the vertical sprite, the horizontal sprite incorrectly renders in front of it.
I am new to working in 3d and am not 100% confident on what the problem is, but I did some research and it sounds like it is caused by the sprites z-fighting. To fix this I tried slightly increasing the y and z-coordinates of the vertical sprite, increasing the camera’s “near” parameter, and changed the offset of the vertical sprite. I also read the Godot docs article on 3D rendering limitations, but most of the issues and proposed solutions seemed more tailored to 3D sprites and materials. I had some success with moving the vertical sprite to be closer to the camera than the horizontal sprite, but I was wondering if there was a more consistent solution that wouldn’t involve moving all vertical sprites to be further forward than the horizontal sprite they are over.

I fixed this by changing the “Alpha Cut” property located in the Sprite3D’s SpriteBase3D class from Disabled to Discard.