You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on the first bullet in the original problem description (Tangents/bitangents are not computed correctly), which is exemplified by glTF-Sample-Models/2.0/NormalTangentTest.
The first model seems to just have some rotation issues with the asset itself, and some of the colors aren't showing up because vertex colors aren't implemented yet.
For the second and third models, the issue seems to just be with the use of multiple UV coordinates.
It seems like that file and the files mentioned in #503 have some kind of error within the gltf file, and this is causing the viewer to crash within Assimp when it is loading the gltf.
I saw that Don McCurdy's gltf viewer is still able to show the model even though it says there are errors within the file, so we could find a way to load the files by ignoring the malformed lines.
It seems like that file and the files mentioned in #503 have some kind of error within the gltf file, and this is causing the viewer to crash within Assimp when it is loading the gltf.
If the errors seem unreasonable, I'm glad to send feedback to Sketchfab. Some viewers (like Facebook 3D Posts) enforce a "no validation errors" policy, and if these are issues you'd rather not work around, requiring stricter conformance from exporters is acceptable. The tolerance in my viewer is more accidental than planned. :)
Well crashing is never a good option :) But if the crash is inside Assimp our best bet would be to fix it there and upstream the change. We could also investigate TinyGLTF
For now I think I should simply modify our copy of MeshAssimp to negate the bitangent, thus moving our current workaround downward so that it doesn't affect the tangents-are-available case. This will be fixed in a more proper way in the new glTF loader that I'm working on.
details:
We render NormalTangentTest correctly (where tangents are computed via MeshAssimp) but we do not render NormalTangentMirrorTest correctly (where tangents are supplied in the model).
When MeshAssimp generates tangents and bitangents, it basically makes tangents follow texcoord U, and bitangents follow texcoord V. The resulting tangent vectors are fairly consistent with a couple popular viewers that I tried, but the bitangent vectors are not. Other viewers use different approaches:
ThreeJS (and therefore Don McCurdy's viewer) does this
ThreeJS (and therefore Don McCurdy's viewer) does this
Note that this change is very recent, and won't be visible in my viewer until threejs r102 is released. But I think BabylonJS (and this viewer) do the same.
Activity
romainguy commentedon Nov 26, 2018
Rotation issue: https://sketchfab.com/models/a4ca0e3864e143af9bf1dffc7fc8029b (you have to zoom into the black sphere to seen the scene). This model also seems to use vertex colors? Our render is definitely off.
Non-default samplers: https://sketchfab.com/models/94b24a60dc1b48248de50bf087c0f042 The tramway and some of the walls are not textured properly, most likely because we don't use the right sampler
None of the textures are loaded for this model: https://sketchfab.com/models/282f497334f64a589edee4e63ad7e428
romainguy commentedon Nov 28, 2018
Another bug: the water in https://sketchfab.com/models/e051a32d21d6453c8fad408082492267 is not transparent. The alpha mask is also not working on the bushes in that scene.
prideout commentedon Nov 28, 2018
I'm working on the first bullet in the original problem description (Tangents/bitangents are not computed correctly), which is exemplified by
glTF-Sample-Models/2.0/NormalTangentTest.Fix up tangents in MeshAssimp to help with #528.
Fix up tangents in MeshAssimp to help with #528.
Fix up tangents in MeshAssimp to help with #528.
magicwhale commentedon Nov 29, 2018
The first model seems to just have some rotation issues with the asset itself, and some of the colors aren't showing up because vertex colors aren't implemented yet.
For the second and third models, the issue seems to just be with the use of multiple UV coordinates.
I realized that I didn't implement alpha masking and blending for unlit materials, which this scene uses.
I'm working on fixing the issues now.
romainguy commentedon Dec 1, 2018
Crash opening this file: https://sketchfab.com/models/f8d3c7506f3545108dcf7f6c170e19e1
magicwhale commentedon Dec 4, 2018
It seems like that file and the files mentioned in #503 have some kind of error within the gltf file, and this is causing the viewer to crash within Assimp when it is loading the gltf.
I saw that Don McCurdy's gltf viewer is still able to show the model even though it says there are errors within the file, so we could find a way to load the files by ignoring the malformed lines.
donmccurdy commentedon Dec 4, 2018
If the errors seem unreasonable, I'm glad to send feedback to Sketchfab. Some viewers (like Facebook 3D Posts) enforce a "no validation errors" policy, and if these are issues you'd rather not work around, requiring stricter conformance from exporters is acceptable. The tolerance in my viewer is more accidental than planned. :)
romainguy commentedon Dec 4, 2018
Well crashing is never a good option :) But if the crash is inside Assimp our best bet would be to fix it there and upstream the change. We could also investigate TinyGLTF
romainguy commentedon Dec 6, 2018
Multi UV sets support is now in. @magicwhale were you able to figure out where the other issues come from?
Fix up tangents in MeshAssimp to help with google#528.
3 remaining items
romainguy commentedon Feb 20, 2019
Thank you. Texture transforms are just not supported at all at the moment. We're moving to a different gltf loader to fix all these issues.
romainguy commentedon Feb 20, 2019
I'm surprised by the tangents though, @prideout wasn't this fixed?
prideout commentedon Feb 20, 2019
Just now reproduced the issue with Normal Tangent Mirror, I'm surprised too. Will investigate.
prideout commentedon Feb 20, 2019
tl;dr:
For now I think I should simply modify our copy of MeshAssimp to negate the bitangent, thus moving our current workaround downward so that it doesn't affect the tangents-are-available case. This will be fixed in a more proper way in the new glTF loader that I'm working on.
details:
We render
NormalTangentTestcorrectly (where tangents are computed via MeshAssimp) but we do not renderNormalTangentMirrorTestcorrectly (where tangents are supplied in the model).When MeshAssimp generates tangents and bitangents, it basically makes tangents follow texcoord U, and bitangents follow texcoord V. The resulting tangent vectors are fairly consistent with a couple popular viewers that I tried, but the bitangent vectors are not. Other viewers use different approaches:
donmccurdy commentedon Feb 20, 2019
Note that this change is very recent, and won't be visible in my viewer until threejs r102 is released. But I think BabylonJS (and this viewer) do the same.
Tangent-related fixups in MeshAssimp.
Tangent-related fixups in MeshAssimp.
Introduce SurfaceOrientation helper class.
Introduce SurfaceOrientation helper class.
Introduce SurfaceOrientation helper class.
Introduce SurfaceOrientation helper class.
Introduce SurfaceOrientation helper class.
romainguy commentedon Apr 24, 2019
Closing this for now. There are still a couple of unsupported features like blend shapes.