Godot: mesh render problems with concave n-gons

Created on 26 Mar 2019  路  7Comments  路  Source: godotengine/godot

Godot version:
3.1 stable

OS/device including version:
Windows 10, GTX 1080, 417.71

Issue description:
Imported a self made model, and got a wrong rendering in the preview window.
Model is made with blender. Exported wavefront object is correctly rendered when imported back into an empty blender project. Object also renders corectly with the Unity engine.

(godot)
http://prntscr.com/n39qih

(blender)
http://prntscr.com/n39rjl

(unity)
http://prntscr.com/n39snu

Steps to reproduce:

  • Use in zip included object (curve.obj)
  • Import it into Godot
  • Drag it into any scene
  • Create a new empty material for the first material slot of the mesh, for better visualisation
  • Inspect model

Minimal reproduction project:
ModelBug.zip

bug documentation import

Most helpful comment

You can also turn the mesh into triangles using the triangulate modifier, as the exporters will generally apply them automatically on export.

The modifier is the preferred way of doing it because it's non-destructive, which makes it far easier to do revisions of the asset or level later on.

All 7 comments

Looks like this is the result of a concave n-gon. If you turn your model into triangles ([ctrl]+[t] in blender) it works.

thanks, with your hint it works.

as a further question: are there any plans to support these kind of meshes in godot? or should I file a feature request?

I think it could still be considered a bug. I'm not sure if there are any conventions when importing convex n-gons, but both blender and unity seem to handle this case correctly while godot has problems triangulating the mesh.

Usually it's preferred to convert models to quads / triangles before exporting them but I think it would be good if godot can import them correctly.

You can also turn the mesh into triangles using the triangulate modifier, as the exporters will generally apply them automatically on export.

The modifier is the preferred way of doing it because it's non-destructive, which makes it far easier to do revisions of the asset or level later on.

I'm not sure if we can solve this on our end. However, we should document the recommendation to triangulate meshes on export by checking the "Triangulate Faces" option in the Blender exporter or adding a Triangulate modifier then checking "Apply Modifiers" in the exporter. This is generally the best approach when working with game engines, as only export-time triangulation can be deterministic.

I believe @AndreaCatania and @RevoluPowered implemented any number of sided polgon support for FBX. Maybe it can be used here.

Can still reproduce on 4d667dadb90bb87245dba877970ff913beafa388

Yep, the new FBX is able to triangulate any sane polygon shape / size.

Was this page helpful?
0 / 5 - 0 ratings