-
-
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
Mesh compression breaks normal #83240
Comments
cc @clayjohn, I think? |
Probably caused by the new mesh compresssion as suggested. Might be a duplicate of #83236, but I'll leave this open for now in case the issues have different causes. This issue also has a proper test project which can be useful. |
Tested on current master: 51f81e1 edit: Disabling Godot built using llvm-mingw on Windows 10, command line Not compressed: Compressed (note the light differences on some 90-degree surfaces, especially the large building):
|
Master build (51f81e1) with UBSAN enabled gives these warnings, which seem to match the tangent conversion in
|
Perhaps we need to clamp res to the 0-1 range? edit: nevermind, 3.34993e-312 is within the 0-1 range, but it is much too small for a float Hmmm 3.34993e-312 is smaller than what even double precision can represent |
Hard to say much about the UBSAN errors or the weird float value, could even be some clang runtime formatting issue. I noticed another problem with the test project (again on 51f81e1) Download and unzip the MRP, delete
|
Hmmm that's a good lead. Perhaps somehow we are getting a tangent array with uninitialized memory through |
One more data point:
godot/servers/rendering_server.cpp Lines 332 to 334 in 51f81e1
Ah, looks like they are NaNs. That's why the value appeared random for you |
This fixes the division by zero when denom is 0 (I just removed it entirely because we normalize right after anyway) and adds a few other things 4f3eddd We can still get NaNs from the normalization for some reason. I still have more to investigate, so not opening a PR yet |
Godot version
v4.2.beta.custom_build [ee118e7]
System information
Godot v4.2.beta (ee118e7) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (Advanced Micro Devices, Inc.; 27.20.21034.37) - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)
Issue description
When mesh compression is enabled (default), the normals of a mesh becomes corrupted. Most likely introduced by #81138 (needs verification). May be related to #82890. Seemed to start appearing after I overrode light materials.
With compression:
Without compression:
Steps to reproduce
(See MRP)
dm3_open_sky.obj
and disableForce Disable Compression
.Minimal reproduction project
UV2 Compression.zip
The text was updated successfully, but these errors were encountered: