Gltf-blender-io: Roundtrip normals import/export incorrect

Created on 28 Mar 2019  路  3Comments  路  Source: KhronosGroup/glTF-Blender-IO

Reported on Twitter:

I was trying to import Sponza scene from glTF Sample models repo. The thing that breaks is: if tangents w is used, then imported normals in blender (and re-exported in glTF) are broken like if w was always 1. I can provide screenshots a bit later if you want.

Possibly related to https://github.com/KhronosGroup/glTF-Blender-IO/issues/230 and https://github.com/KhronosGroup/glTF-Blender-IO/issues/309.

bug exporter importer

All 3 comments

It was me who submitted this bug. I'll provide a couple of screenshots and more description.
So, what I'm trying to do is put several gltf scenes into one, so I've taken Sponza from https://github.com/KhronosGroup/glTF-Sample-Models and imported it into Blender 2.80.

After that, I've exported it out and then noticed that normals aren't proper.

Original scene:
original

After export:
after_export

It's kinda hard to see, so I've output only the normals (viewspace) from my engine (since I have no idea how to do it in Visual Studio glTF Preview).

Original normals:
good_normals

Normals after export:
broken_normal

This happens when you ignore tangent w component and don't multiply the bitangent for the tangent-space construction (or if it's always the same sign).

For reference, in Blender after import it looks good:
after_import

And, by the way, importing sponza takes like 5 whole minutes on my laptop, which is kinda strange, because there are plugins for 2.79 that do it almost instantly (but they also don't work that good after importing, so there's that).

This might be fixed in #414.

@Spo1ler Can you confirm this is now solved by #414 ?
I can't see any normal issue after import / export, and visualisation in blender (import again) or https://gltf-viewer.donmccurdy.com/

Closing for now, but don't hesitate to reopen / comment if you still have an issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spiraloid picture spiraloid  路  3Comments

capnm picture capnm  路  5Comments

WindyDarian picture WindyDarian  路  5Comments

Quinten123 picture Quinten123  路  4Comments

julienduroure picture julienduroure  路  5Comments