google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.63k stars 1.87k forks source link

gltfio: a problem when loading a model #1467

Closed Yzou-NaO closed 5 years ago

Yzou-NaO commented 5 years ago

I tried to load a model by gltfio

use other gltf_viewer(clay-viewer) clay_viewer use filament gltf_viewer gltf_viewer-min I also tried to use filament sample_full_pbr pbr-min

The model looked different only in filament gltf_viewer, I'd like to know if this is a bug.

prideout commented 5 years ago

Can you attach the glTF file to the issue?

Yzou-NaO commented 5 years ago

https://github.com/Yzou-NaO/glTF-Model Here is the model. qingting.zip And here is another model which I can't play its animation with filament gltf_viewer.

prideout commented 5 years ago

Thanks, I can reproduce the animation issue in the qingting model and the specular issue in the rabbit mode. We'll take a look.

prideout commented 5 years ago

@romainguy, the stone rabbit might be a non-bug but I'm not sure yet. You might be interested because the asset seems fine at first glance. It is not using the spec-gloss extension and it provides tangents, a normal map, a metallic-roughness map, and a base color texture. Filament looks more like ThreeJS if I hack our shaders to darken the baseColor. I confirmed that we are setting up sRGB correctly and that the normals/tangents look reasonable. (Btw I tried to use the new Blender to break apart the GLB, but the exporter failed to preserve tangents and sRGB.)

As for the animation issue in the qingting model, I'll take look at that next.

prideout commented 5 years ago

The qingting model has two parallel node hierarchies: one that is rooted into the scene, and one that is orphaned (does not belong to any scene).

The animation is only in the orphaned hierarchy so it gets ignored by gltfio.

Each mesh is referenced by both hierarchies, so applying both sets of transforms seems reasonable. I'll go ahead and make a fix to ensure consistency with ThreeJS. I'll also file a Khronos issue because I don't see anything in glTF spec that allows for this, even though Cinema4D apparently relies on this behavior.

(Regarding the rabbit lighting issue, I'm going to set aside since we're not sure it's a bug, we would need to see a comparison that uses the same IBL / light sources.)

prideout commented 5 years ago

https://github.com/KhronosGroup/glTF/issues/1649

qingting.gltf.zip

Yzou-NaO commented 5 years ago

Thank you!

prideout commented 5 years ago

@Yzou-NaO Given the response to my glTF ticket, unfortunately there is a bug in your asset pipeline (perhaps in an exporter plugin), not in Filament itself.