GLTFSceneKit icon indicating copy to clipboard operation
GLTFSceneKit copied to clipboard

Seems Tangent vectors are being calculated and handled incorrectly

Open johanos opened this issue 7 years ago • 4 comments

https://github.com/cx20/gltf-test

I've been running the tests found at that github project on the model viewer and it seems like the normal tangent test is failing

https://github.com/cx20/gltf-test/tree/master/tutorialModels/NormalTangentTest

we are supposed to get something like

this is from http://sandbox.babylonjs.com/

image

but we end up getting something like this.

image

the two "spheres" should be exactly the same, but they arent' I haven't looked into it too much, but it seems like the way the tangent vectors that are read from the GLB are being calculated incorrectly

johanos avatar Dec 06 '17 22:12 johanos

Thank you for reporting! It used to be correct, but now it's wrong, it might be because of my workaround. And it seems that some calculations in the SceneKit shader was also changed around macOS 10.13.1. Anyway, it should be fixed.

magicien avatar Dec 06 '17 23:12 magicien

its working on the newest version of iOS, can't check macOS because i can't update my computer yet but it seems like this isn't an issue after all :)

johanos avatar Dec 07 '17 16:12 johanos

I checked the test model with macOS 10.13.2 beta 6 (17C85a), and it's not rendered correctly.

Front: looks flat normal_tangent_front

Back: looks opposite normal_tangent_back

magicien avatar Dec 07 '17 20:12 magicien

sidebar update: https://emackey.github.io/testing-pbr/normal-tangent-readme.html here's a nice write up as to why this is important.

sadly I can't work on this until I can update my computer (not up to me) but i'll try to look into this as well and see what's going on

at least for iOS its working okay image

johanos avatar Dec 12 '17 21:12 johanos