godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
87.08k stars 19.56k forks source link

MeshInstance2D Gets Artifacts if Object Is Rotated. #85033

Open mifth opened 8 months ago

mifth commented 8 months ago

Godot version

4.2

System information

Windows 11

Issue description

MeshInstance2D gets artifacts if an object Is Rotated.

image

image

Steps to reproduce

  1. Create MeshInstance2D
  2. Set Mesh as New Capsule Mesh.
  3. Add Texture in the MeshInstance2D
  4. Rotate the MeshInstance2D

And artifacts will appear.

Minimal reproduction project

--

mifth commented 8 months ago

Some settings of the Capsule Mesh.

image

clayjohn commented 8 months ago

I think this is z-fighting caused by using a 3D mesh in a MeshInstance2D. The 2D renderer can't do depth culling because it only uses 2 dimensions. So when you use a 3D mesh, it can really mess things up.

mifth commented 8 months ago

I've found another strange thing. The artifact depends on Segments amount. @clayjohn do you think it's still z-fighting?

image image