-
-
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
Shading errors on gltf imports #83345
Comments
Can you try reimporting with force disable compression enabled in the import settings? |
Enabling the "Force disable compression" option gives this difference (left with option disabled, right with option enabled): v4.2.beta1.mono.official [b137180] So it does indeed seem to prevent this issue. |
@stevenctl are you able to share that mesh? |
Looks like verts are duplicated on export from Blender. Trying to merge vertices and re-export/import yields the same separation of verts. Importing to 4.1.1 looks ok though. |
For the mesh @stevenctl provided, I get a correct-looking import if I disable "Ensure Tangets". "Force Disable Compression" doesn't affect the result after that. |
Is this the same issue as #84270 ? Is this fixable in cases of incorrect normals or are we hitting some limit of mesh compression? Also, is there a way to detect that we have significantly distorted normals with mesh compression and warn the user, disable compression or fail the import in such cases? |
Godot version
v4.2.beta1.mono.official [b137180]
System information
Godot v4.2.beta1.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 31.0.15.3699) - Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz (16 Threads)
Issue description
I'm using blender to export assets as gltf. When importing gltfs into Godot 4.2, I observe shading issues where parts of surfaces are darker or lighter in odd spots.
As a minimal example, I can even reproduce this with blenders "default cube" as it appears at the startup of the application without any modifications to either mesh or material. Checking "Data>Mesh>Tangets" on export does not affect the outcome.
In the following two pictures, the left cube is the imported blender default cube, the right one is a MeshInstance3D with a 2x2x2 BoxMesh for comparison.
v4.2.beta1.mono.official [b137180]
![image](https://private-user-images.githubusercontent.com/5133378/275271498-9e83b6f2-f402-4d0c-af52-7567f1884474.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDc1MjQsIm5iZiI6MTczOTE0NzIyNCwicGF0aCI6Ii81MTMzMzc4LzI3NTI3MTQ5OC05ZTgzYjZmMi1mNDAyLTRkMGMtYWY1Mi03NTY3ZjE4ODQ0NzQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAyNzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTU5N2M1NWU1NWQwNTU3MmMxYmVlOThhNjRjMzBjNmQ0YTc4YWU4ZTYxMDBkZGY3YTliZTYyMjQwMjc3Zjg3NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6OpQJzx_j2ncQbcujPdkkNa3WMfTd3AUsikjfAsBLXI)
When I import the same gltf in v4.1.1.stable, the result looks correct, so I assume this to be a regression:
![image](https://private-user-images.githubusercontent.com/5133378/275271520-e224460b-0443-4cf1-ac0b-390b0f531a5c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDc1MjQsIm5iZiI6MTczOTE0NzIyNCwicGF0aCI6Ii81MTMzMzc4LzI3NTI3MTUyMC1lMjI0NDYwYi0wNDQzLTRjZjEtYWMwYi0zOTBiMGY1MzFhNWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAyNzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWNmMmMzNjIyODRhYmUxOTIxMTlkMGRlYjc1Y2IwZTY4NjgzODc3MGY0ODE3ZTMzZWU1YjAxMzkzMmQxNDlhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.bTc1R0aPhqPzzqEfSX4b8RcLaUrnORK8hcareiM3Rus)
v4.1.1.stable.mono.official [bd6af8e]
Other simple examples of some subdivided/beveled cubes, as seen in the "Advanced Import Settings" dialog in v4.2.beta1.mono.official [b137180]:
![image](https://private-user-images.githubusercontent.com/5133378/275271716-6e6ae952-78c9-4d52-8627-30bb2b64b617.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDc1MjQsIm5iZiI6MTczOTE0NzIyNCwicGF0aCI6Ii81MTMzMzc4LzI3NTI3MTcxNi02ZTZhZTk1Mi03OGM5LTRkNTItODYyNy0zMGJiMmI2NGI2MTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAyNzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGJlNjg5YzRlYjgyMTkxMGZlMmY2ZDUzMzEzZGI0NzA3MzMwYzBmMTgwNTNjZTE0NTMxMTc2ZGUzOWE1Nzk0ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.VcCQErnxa9A-W8_QcKo9milJoJGbW51DdWKPEZWu8gY)
![image](https://private-user-images.githubusercontent.com/5133378/275271747-80edb38d-2ace-4aa7-ab0d-9bc0df69fec5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDc1MjQsIm5iZiI6MTczOTE0NzIyNCwicGF0aCI6Ii81MTMzMzc4LzI3NTI3MTc0Ny04MGVkYjM4ZC0yYWNlLTRhYTctYWIwZC05YmMwZGY2OWZlYzUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDAyNzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTU2MTg2MGMzMTIxMGFkODgwN2EzY2QzZTk5MzA4YmZiOTAwMjcwNzYwZjFiNGI2Mzk2Mjc5ZDE2ZjY4MTcwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.S2ZuDB0qtrKymKWpSwpLF88hoETyk5YGrIWn7TF86e0)
Steps to reproduce
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: