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

Bear glTF 2.0 model is not displayed in Cesium.js v1.40 or later #6416

Closed
cx20 opened this issue Apr 3, 2018 · 18 comments · Fixed by #8958
Closed

Bear glTF 2.0 model is not displayed in Cesium.js v1.40 or later #6416

cx20 opened this issue Apr 3, 2018 · 18 comments · Fixed by #8958

Comments

@cx20
Copy link

cx20 commented Apr 3, 2018

I tried to display the bear glTF model that was in sketchfab with the latest version of Cesium.js.
https://sketchfab.com/models/f2f13a8630004b1c82730d8b9ffa0e1f

However, in Cesium.js v1.40 and later, an error is displayed and it seems that it is not displayed correctly.

Cesium.js v1.39 + Bear glTF model result:
image

Cesium.js v1.44 + Bear glTF model result:

Cesium.js:532 
An error occurred while rendering.  Rendering has stopped.
undefined
TypeError: i.clampTime is not a function
TypeError: i.clampTime is not a function
    at Array.<anonymous> (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:497:22244)
    at h (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:496:19348)
    at c.update (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:496:21384)
    at Ae.update (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:498:20408)
    at a.update (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:492:8011)
    at tt (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:525:21935)
    at Ke (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:525:19739)
    at Qe (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:525:17745)
    at lt (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:525:25765)
    at ut (https://cdn.rawgit.com/cx20/gltf-test/279cba56/libs/cesium/1.44/Cesium.js:525:25933)
@lilleyse
Copy link
Contributor

lilleyse commented Apr 4, 2018

I opened a fix in #6422

@cx20
Copy link
Author

cx20 commented Apr 8, 2018

Although it may be another problem, in Cesium.js v1.42 or later, it seems that animation-enabled models are not animated. BoxAnimated, CesiumMan, Monster, etc..

@emackey
Copy link
Contributor

emackey commented Apr 8, 2018

@cx20 There was a change there, add shouldAnimate: true to the Cesium.Viewer constructor options. The default behavior starts in pause now.

@cx20
Copy link
Author

cx20 commented Apr 8, 2018

@emackey Thank you for telling me that the options have changed. I modified the sample and confirmed that the above model was animated.

@cx20
Copy link
Author

cx20 commented Apr 8, 2018

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 9, 2018

@cx20 @emackey thanks for reporting all these glTF issues! OK to close this one?

@emackey
Copy link
Contributor

emackey commented Apr 9, 2018

@pjcozzi The related PR #6422 didn't get merged yet. @lilleyse is it being held up by the lack of a test model?

@emackey
Copy link
Contributor

emackey commented Apr 28, 2018

This auto-closed because I merged the animation fix. I think I'm still seeing an issue where the bear renders inside-out when viewed from the back. Not sure what that's about...

@mramato mramato reopened this Apr 28, 2018
@emackey
Copy link
Contributor

emackey commented Apr 29, 2018

Well since @mramato reopened this, I decided to bisect it. This was a slightly more involved bisect than usual since I had to retroactively apply the ConstantSpline patch to each bisection point along the history since 1.44 in order to see this new rendering error, that only presents itself when the bear's animations are enabled.

Anyway, git bisect says: 417c3f9 (ironically named "fixed some artifacts")

Sure enough, this commit was introduced with Log Depth, #5851. That makes sense since 1.44 (plus the ConstantSpline patch applied retroactively) did not have this problem. This is a "new since 1.44" bug.

/cc @lilleyse @bagnell

@emackey
Copy link
Contributor

emackey commented Apr 29, 2018

BearOnBalloons.zip

@emackey
Copy link
Contributor

emackey commented Apr 29, 2018

The side view just shows some slicing through the balloons. The rear view is so bad it looks like you're seeing the front of the bear.

brokenbearonballoons

@mramato
Copy link
Contributor

mramato commented Apr 30, 2018

@emackey do you think this is fixed by #6513

@emackey
Copy link
Contributor

emackey commented Apr 30, 2018

do you think this is fixed by #6513

Sadly no. I just merged master into that branch, but the artifacts look the same.

@emackey
Copy link
Contributor

emackey commented Apr 30, 2018

I've run through a bunch of other models, and haven't found any other than the bear that display this particular problem. Also, the problem only appears when animations are enabled. So... some bad interaction between something animated and the diffs in 417c3f9, it would seem.

@lilleyse
Copy link
Contributor

It might be #6447.

We never figured out why log depth and skinned meshes don't play well together. The current workaround is an improvement but sometimes reveals artifacts like this.

@bagnell
Copy link
Contributor

bagnell commented Apr 30, 2018

Yes, that's the issue. If you remove the workaround, this model works fine. I'm looking into it.

@mramato
Copy link
Contributor

mramato commented May 1, 2018

@emackey Did we check to see if this model has the same normalized bone weights problem as Cesium Man?

It looks unlikely that we will get to this for the 1.45 release today and just want to make sure the issue is model specific or at least not the sign of a larger problem.

@emackey
Copy link
Contributor

emackey commented May 1, 2018

No, the Bear model has the opposite problem, it is being damaged by a workaround that's in place for the sake of the broken Cesium Man model.

Let's not hold the release for this.

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

Successfully merging a pull request may close this issue.

6 participants