Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polly glTF model does not display correctly in WebGL environment #2714

Closed
cx20 opened this issue Jun 20, 2020 · 8 comments · Fixed by #2725
Closed

Polly glTF model does not display correctly in WebGL environment #2714

cx20 opened this issue Jun 20, 2020 · 8 comments · Fixed by #2725
Assignees
Labels
bug gltf

Comments

@cx20
Copy link

@cx20 cx20 commented Jun 20, 2020

Describe the bug

I tried displaying the Polly glTF model in Filament 1.7.0.
However, after a few seconds the display goes wrong.

filament_polly_problem

To Reproduce
https://cx20.github.io/jsdo.it-archives/cx20/M2lx/

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Browser : [Chrome 83]
  • GPU: [Intel(R) UHD Graphics 617]
  • Backend: [ANGLE]
@romainguy romainguy added gltf bug labels Jun 20, 2020
@prideout
Copy link
Member

@prideout prideout commented Jun 22, 2020

Taking a look now. I suspect that Animator is producing NaN's during the bad frames, although I already fixed a slew of quaternion-related NaN bugs a while back. Happens on desktop too.

@cx20
Copy link
Author

@cx20 cx20 commented Jun 22, 2020

BTW, when I tried to display Polly with the latest version of Filament, I found a new artifact on Polly's head. It looks like an antenna, but I'm wondering what it is.

Filament latest version + Polly glTF model result:
image

@prideout
Copy link
Member

@prideout prideout commented Jun 22, 2020

Ha, I thought that was the antenna but yes it seems to be an artifact! I will take a look.

Regarding the original bug, it appears that our Animator is not applying CUBICSPLINE interpolation correctly for morph weights, although we do apply this interpolation correctly for other types of rigid body transforms.

The glTF spec is somewhat unclear about the buffer layout for this situation, and there are no models in the Khronos test suite that exercise cubic interpolation in conjunction with morph weights. However this Khronos issue has some helpful information that I will use to make our implementation more consistent with the ecosystem.

prideout added a commit that referenced this issue Jun 22, 2020
Tested with Polly the robo-hound and ensured that InterpolationTest
did not regress.

Partial fix for #2714.
prideout added a commit that referenced this issue Jun 22, 2020
Tested with Polly the robo-hound and ensured that InterpolationTest
did not regress.

Partial fix for #2714.
prideout added a commit that referenced this issue Jun 22, 2020
Tested with Polly the robo-hound and ensured that InterpolationTest
did not regress.

Partial fix for #2714.
@prideout
Copy link
Member

@prideout prideout commented Jun 23, 2020

The antenna artifact is due to non-normalized skinning weights in the model and is therefore not a Filament bug.

The artifact goes away after adding this line to gltf_viewer.cpp:

configuration.normalizeSkinningWeights = true;

Another way to see this is to use gltf-validator, e.g. by viewing the model in Don McCurdy's glTF viewer and looking at the warnings / errors.

@romainguy
Copy link
Collaborator

@romainguy romainguy commented Jun 23, 2020

Is there a downside in normalizing the weights by default in our library?

@prideout
Copy link
Member

@prideout prideout commented Jun 23, 2020

In the past we normalized by default, but we made it opt-in after noticing negative impact to loading time.

@prideout
Copy link
Member

@prideout prideout commented Jun 23, 2020

Default behavior was changed in #2621

prideout added a commit that referenced this issue Jun 23, 2020
- Allow JavaScript and Java / Kotlin clients to configure this setting.
- Opt in by default (this was disabled in #2621)
- Optimize large assets like Bistro by iterating through prims only when
  the asset actually has skins.

Fixes #2714.
prideout added a commit that referenced this issue Jun 23, 2020
- Allow JavaScript and Java / Kotlin clients to configure this setting.
- Opt in by default (this was disabled in #2621)
- Optimize large assets like Bistro by iterating through prims only when
  the asset actually has skins.

Fixes #2714.
prideout added a commit that referenced this issue Jun 23, 2020
- Allow JavaScript and Java / Kotlin clients to configure this setting.
- Opt in by default (this was disabled in #2621)
- Optimize large assets like Bistro by iterating through prims only when
  the asset actually has skins.

Fixes #2714.
prideout added a commit that referenced this issue Jun 23, 2020
- Allow JavaScript and Java / Kotlin clients to configure this setting.
- Opt in by default (this was disabled in #2621)
- Optimize large assets like Bistro by iterating through prims only when
  the asset actually has skins.

Fixes #2714.
@cx20
Copy link
Author

@cx20 cx20 commented Jun 23, 2020

@prideout Thank you for the repair. I have confirmed that the latest version resolves the issue.

Filament latest version + Polly glTF model result:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gltf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants