-
Notifications
You must be signed in to change notification settings - Fork 313
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
Incorrect Tangent/Bitangent export #936
Comments
Hi Guy's, However i'm a bit confuse about your explanation with bitangent while there is no bitangent information into Babylon file and/or GLTF 2.0.
In any case, i believe the problem is arround this line, which may compute an incorrect W for the tangent ( maybe an issue about floating point rounding).
G. |
Hey, Your speculation about it stemming from setting the tangent W makes sense; however I haven't had much success with my continued testing. |
this is what i get when force W = 1; And with the new W calculation Any thoughts ?? Let me know if this one is better.. |
When comparing my previous results it looks like forcing W=1 is closer but still showing some areas of faceting. The new W calculation looks near-identical to exporting without tangents; lots of faceting within single smoothing groups. Here's my close up comparison of your W=1 image with the blender export. Here's the .blend and glb export from blender. |
Hey, The other point is the faceting which come to another reason related to the vertices optimisation. I will doing a PR for the first point, the second point is a missinformation about the behavior of the exporter. We may update the documentation accordingly. Here the result |
Hey again, Thank you for the work fixing this; the [Try to optimize vertices] is a good callout. I had a chance to experiment with the change and unfortunately still seems the calculation of W is still causing artifacts which a few small ones can be seen in the screenshot you shared: Here are the max and glb files from my testing; Thanks again, super appreciate the help! |
regarding the second exemple, i have better result with the new W method based on UV instead of already calculated bi-tangent. |
Hey, Looking at your latest test it seems there are a lot of areas where things seem inverted. The chamfers look flipped as do the different sides of the screw heads. I'll attach the glb export from blender since it is a good reference of exactly what it looks like in every other editor. Comparing the tangents and bitangents that blender outputs it looks like there is a basis flip happening? Most obvious part is on the cylinder bitangent where there's a clear edge with teal and pink color. This kind of edge should only show up on UV seams but there isn't one there. Here's the glb from blender |
@RowanGryder hope you're well. |
@RowanGryder any news? i will close the issue if not. Regards. |
@pandaGaume Sorry for the delay. So this all has me wondering if, assuming my speculation is correct and that it is caused by non-zeroed transforms, is it possible to do this automatically on export while maintaining local orientations in the max file? Kind regards, |
Hello,
I've been experiencing an issue for some time now where using the
Export Tangents
option on the 3Ds Max exporter gives good Tangents but artifact heavy Bitangents. In the past I've just left this option unchecked and used smoothing groups and slight model tweaks as a workaround to at least give a adequate result. Unfortunately I've finally found an example where none of these previous workarounds fixe the smoothing issues present.Using the debug textures it can be seen when exporting without tangents the tangents and bitangents appear faceted/flat shaded. Exporting with tangents gives a nice smooth result for the tangent result but an artifact filled bitangent result which ruins the smoothing in random places.
Example:
https://user-images.githubusercontent.com/23561431/108782674-035e5980-753a-11eb-8032-e5f62161a791.png
Closeup:
https://user-images.githubusercontent.com/23561431/108782636-f0e42000-7539-11eb-83a8-327f52c01078.png
I also did some testing with exporting with tangents from blender and found it gave perfect tangent and bitangent.
The text was updated successfully, but these errors were encountered: