-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
4.2 imported models have broken normals #85406
Comments
I can confirm the issue on 4.2-rc2 on Linux (AMD Radeon RX Vega M). On the other hand I also see normal issues on 4.1.3-stable, albeit not as bad, but still not all correct: I also see these normal issues on https://modelviewer.dev/editor/ So I assume these are not the main problem to focus on, but the difference seen between 4.1.3 / Modelviewer and 4.2-rc2. |
Early testing shows that the issue goes away when I'll see if I can find the root cause of the normal corruption though. Another note: This is different than issues like #84270. While this model contains invalid UVs (for generating tangents), the issue is present even when "ensure tangents" is disabled. So the issue likely doesn't have to do with tangent generation. |
Just did some more investigating. It turns out this issue comes from the original .GLB having bogus tangents. I imported the model into blender and then exported it without tangents and it looks correct when using compression (as it uses the generated tangents provided by Godot). This is a difficult situation as technically the model itself is broken, its just that Godot didn't care before. Now Godot is more sensitive to broken meshes (which is why we have the I have re-labelled this issue as a documentation issue as we need to work on communicating to users that the option is there to disable compression and potentially fix issues with broken models. In the future, we need to investigate some other form of analysis or warning. For example, we could test a few tangents on import and warn users if bogus tangents are detected. But doing so would come with a performance cost and may not be foolproof, so it is something we need to discuss and investigate further. |
I agree, we were just discussing that in the contributors chat earlier today. Most users are only seeing "force disab..." which is super unhelpful.
I just ensured that the "Tangents" option was unchecked, then I exported to GLB and imported it into Godot. Using Blender 3.4.1 if it matters.
Which is totally fair. The fact that tangents now matter is a new change that came in 4.2. It's only for compressed meshes. Our compression scheme requires valid tangents in order to compress normals. We added the "force disable compression" option knowing that there will be meshes floating around with broken tangents. To me, a proper solution here is going to require making it easier to identify this issue and resolve it (the resolution will be to check a box in the import settings). We just need to somehow communicate effectively to users without spamming them with errors. |
Hi, I was wondering if my issue is related to this issue :) I've been messing with import settings, disabling compression and tangent, but nothing has changed. Thanks for your time and dedication! System information |
@killercrash your normals seem flipped, rather than this specific compression related issue. The blue surfaces on the apartment block normals are forward facing, but the red are backward facing. You need to check your normals in your 3d program to verify there is no issue there first. |
I can confirm I have exactly the same issue as the OP. In my own tests, the compression seems to wreck the normals. It took a very long time to find this problem, and as mentioned, the toggle for compression is expressed in the opposite way than expected. I'm fairly sure I also would have tried turning it off if it had been enabled to indicate compression was active. |
It should be possible to rename the option and invert its behavior as long as we have a compatibility handler to port over the old value on existing resources. |
@ijidau I've tried to check the .fbx in Blender and the normals looks ok apparently :/ |
@killercrash you've got quite a few overlapping edges in your mesh where I've marked yellow. These will cause the shading issues you are seeing. |
@killercrash actually I've just spotted some more. Check your mesh carefully, as you have connected edges in some strange ways that cause them to overlap. Also double check you haven't got any duplicated faces, edges, verts etc. A bit of mesh cleanup should solve your problems. |
For me it's still broken on Godot 4.3, e.g. this model: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/Fox/glTF-Binary I'm on MacOS (M1) and on the Mobile renderer. Edit: |
@rafrafek Can you upload an MRP that reproduces the issue? When I download that model and import it into the engine it looks like the model on the left (on a M2 Mac). |
Hi @clayjohn, I tried to reproduce it in an MRP and now instead of having dark strips in becomes entirely darker when rotating: |
Thank you! I have copied your message into a new issue so we can track it #96484 |
This issue is fixed in Godot 4.2.2 and Godot 4.3. I strongly recommend upgrading to one of those versions. 4.2.2 will be a totally seamless upgrade. |
Godot version
v4.2.beta6.official [6415006]
System information
Godot 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
ProblematicModel.zip
DebugNormalsShader.zip
The text was updated successfully, but these errors were encountered: