JibhON
October 12, 2024, 11:37am
1
Godot Version
v4.2.stable.mono.official [46dc27791]
Question
I have issues with importing my model specifically in .gltf and .glb formats. The normals gets all messed up as shown on the image below.
(.obj model on top works perfectly but .glb doesn’t)
(here it is in an online gltf viewer https://gltf-viewer.donmccurdy.com/ to proof that the export works fine)
I’ve tried triangulating, applying the armature modifier and changing the settings of export in blender and in godot I tried:
applying a seperate material
reimporting it with every setting of light baking
disabling LODs
disabling and enabling random options
but nothing works. Any help would be appreciated thanks!
I’m not sure that’s your case, but once I had a problem where the mesh normals were all messed up, and I ended up fixing it by clearing the custom split normals data on Blender.
2 Likes
JibhON
October 12, 2024, 12:50pm
3
Unfortunately not. I had no custom split data.
This may be related to an issue that is hopefully fixed as of 4.2.2:
opened 10:56PM - 26 Nov 23 UTC
closed 09:28AM - 27 Feb 24 UTC
bug
confirmed
topic:import
topic:3d
### Godot version
v4.2.beta6.official [64150060f]
### System information
Godo… t v4.2.beta6 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3623) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)
### Issue description
When I import a model it will have anywhere from slightly to very messed up normals on surfaces which are completely flat. This happens both when importing the model into 4.2 or when using the automatic upgrade from 4.1 to 4.2.
The models show completely expected normals in blender, godot 4.1, and other 3D model viewers. They only get messed up specifically in godot 4.2. I tried pretty much every export option in blender and every import option within godot and could not find anything that would change this behaviour.
## Obviously wrong normals

## Other versions

## Blender shows regular normals

### Steps to reproduce
Import a .glb model with a complex flat face into a 4.2beta version and it may end up having messed up normals.
### Minimal reproduction project
[4.2b6_gltf_import_test_project.zip](https://github.com/godotengine/godot/files/13468337/4.2b6_gltf_import_test_project.zip)
[ProblematicModel.zip](https://github.com/godotengine/godot/files/13468335/ProblematicModel.zip)
[DebugNormalsShader.zip](https://github.com/godotengine/godot/files/13468340/DebugNormalsShader.zip)
opened 01:37PM - 11 Jan 23 UTC
bug
topic:rendering
needs testing
topic:import
topic:3d
## Godot version
4.0 beta10, beta11, beta12
## System information
Windows … 10, Nvidia GeForce GTX 1060 (528.02) / Vulkan
linux mint Nvidia GeForce GTX 1060 / Vulkan
## Issue description
remark: the material used on the models has seamless textures,
u,v coordinates of individual vertices can be <0 or >1.
### export method 1 (blender to glTF - tangents checkbox off)
When exporting models from a blender through GLTF with default settings(tangents checkbox off),
with some(not all) 3d model, such a problem is observed:

The bug flip Normal Shading Line not lie on the edge, and located inside the triangle.

models on which this situation occurs look equally wrong as in Godot 4.0 beta10, beta11,
so in the Godot 3.4
### export method 2 (blender to glTF - tangents checkbox on)
**a: for Godot 3.4** - completely treated the situation and gave a model with the right Normal Shading
**b: for Godot 4.0 beta10-12** flip NormalShading lines inside the triangles disappear, but now Normal Shading is buggy in a different way. On one side of the wall, the Normal Shading is correct, on the other side wrong.
The surface of the bricks that should be illuminated turn out to be darkened, and vice versa.
The picture demonstrates the side with wrong Shading:

### export method 3 (blender to obj):
Godot 4.0 beta10-12 When import models through OBJ format, we get a mesh with the right Normal Shading.

## Steps to reproduce
Open the project / testScene and see three mesh obtained by three different import methods.
First mesh from global world origin, has a glitch at the top, where the red arrow points.
Second mesh has sides with incorrect normal shading - bricks are darkened from above and lightened from below.
Third mesh (from global world origin) has no glitches - example of correct normal shading.
## Minimal reproduction project
[glTF_BugNormalShading.zip](https://github.com/godotengine/godot/files/10392787/glTF_BugNormalShading.zip)
**model blender file**
[ruin_D300_.zip](https://github.com/godotengine/godot/files/10392802/ruin_D300_.zip)
But you should also be able to work around the issue in 4.2 by turning off compression in the mesh import options:
1 Like
JibhON
October 12, 2024, 4:29pm
5
I’ve tried everything from before on version v4.3.stable.official [77dcf97d8], enabling Force Disable Compression on the old version and the same thing in a fresh project but it is still exactly the same as in the original. Thanks for the response though!
JibhON
October 13, 2024, 7:05pm
6
I FINALY FIGURED IT OUT!
The issue was that my UVs were saved as secondary UVs.
1 Like
system
Closed
November 12, 2024, 7:05pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.