google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Some gltf items are not rendered properly #324

Closed bkkite closed 5 years ago

bkkite commented 6 years ago

Hi, I have problems trying to convert from gltf to sfb.

Original in gltf viewer viewr

Sfb in AndroidStudio viewer androidstudio

Using default matrial in Gradle pluging.

This are files: files.zip

Why color of materials are so differents? and What are these black blocks?

gstanlo commented 6 years ago

The colors are probably different because the two viewers are using different environment lighting.

The black blocks appear to be from NaNs stored in the glTF's tangents and bitangents. The Sceneform converter uses those attributes, while the online viewer ignores them and regenerates them on its own, which is why there's a difference. Notice that there's a significant amount of errors present in the glTF file as reported by the glTF validator.

bkkite commented 6 years ago

The colors are probably different because the two viewers are using different environment lighting.

How can i setup this in ArCore sceneform?

The black blocks appear to be from NaNs stored in the glTF's tangents and bitangents. The Sceneform converter uses those attributes, while the online viewer ignores them and regenerates them on its own, which is why there's a difference.

Yes we don't export tangents and bitangest, but why you don't do the same as online viewer and recreate them? i know is not the best solution. But it's better than drawing black blocks, right?

Notice that there's a significant amount of errors present in the glTF file as reported by the glTF validator.

We created the gltf from an automatic process reading a database where we saved our building objects. About errors, we are working to solve them. But we don't think this is the problem. Most of them are information that is not in use or precission problems when we write to text and what is saved as binary.

Thanks!

romainguy commented 6 years ago

We should definitely detect NaNs and generate our own tangent/bitangent in that case.

gstanlo commented 6 years ago

That's my mistake, I looked at the output which contained NaNs and assumed they came from the input buffer, but none of the primitives appear to be specifying tangents/bitangents. Sceneform should be generating them, and it appears to be a bug that it's generating NaNs.

tpsiaki commented 5 years ago

This is fixed as of Sceneform 1.7