Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBJ import has broken smooth normals on certain files since 4.0.beta16 #84357

Open
Calinou opened this issue Nov 2, 2023 · 0 comments
Open

Comments

@Calinou
Copy link
Member

Calinou commented Nov 2, 2023

Godot version

4.0.beta16, 4.1.2.stable, 4.2.beta 6afd320

System information

Fedora 38, GeForce RTX 4090 (NVIDIA 535.113.01)

Issue description

OBJ import has broken normals on certain files in 4.0.beta16 and any later version, but 4.0.beta15 and earlier are not affected by this issue. Notice how certain parts of the scene are overly smoothed out:

OBJ 4.0.beta15 OBJ 4.0.beta16 and later glTF import Blender OBJ import
Screenshot_20231102_120740 Screenshot_20231102_115918 Screenshot_20231102_120520 Screenshot_20231102_114434

In comparison, glTF import in Godot or OBJ import in Blender restitutes normals correctly (the source file is 100% flat-shaded).

This occurs regardless of the import mode chosen (Mesh or OBJ as Scene), and regardless of whether scaling options are used at import.

PS: Why is the OBJ import being smoothed out automatically anyway (even in 4.0.beta15 where it usually looks good enough)? I'd expect this to be something you have to explicitly opt into (along with a max angle setting). Disabling Generate Tangents and Optimize Mesh doesn't affect this.

Steps to reproduce

  • Import a 3D OBJ file as a mesh or scene.
  • For comparison purposes, import this OBJ file in Blender (using either the standard or legacy importer1) then export it as glTF. Import that glTF scene in Godot.

Minimal reproduction project

test_obj_gltf_import_normals.zip
Open octavus_obj.tscn for testing. Make sure to remove .godot/ after switching Godot versions.

Footnotes

  1. I used the legacy importer in my tests, but the results should generally be identical with the standard importer.

@Calinou Calinou changed the title OBJ import has broken normals on certain files since 4.0.beta16 OBJ import has broken smooth normals on certain files since 4.0.beta16 Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant