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

Crash when loading glTF's KHR_texture_transform without a sampler #7916

Closed
emackey opened this issue Jun 6, 2019 · 2 comments · Fixed by #8076
Closed

Crash when loading glTF's KHR_texture_transform without a sampler #7916

emackey opened this issue Jun 6, 2019 · 2 comments · Fixed by #8076

Comments

@emackey
Copy link
Contributor

emackey commented Jun 6, 2019

Cesium's implementation of the KHR_texture_transform extension of glTF makes poor assumptions that the optional sampler will be defined.

https://github.com/AnalyticalGraphicsInc/cesium/blob/90b130edea858b7b6b6a1575422b0b2654f2ae97/Source/Scene/processPbrMaterials.js#L94

In the above, gltf.samplers need not be defined, and gltf.textures[n].sampler is likewise optional, leading to a rather fancy message:

Cannot read property 'undefined' of undefined

Here's a sample model for testing.

TexRotateTest.zip

@mramato
Copy link
Contributor

mramato commented Aug 14, 2019

So it looks like the behavior is to have repeatS/repeatT be false if there's no sampler?

@emackey
Copy link
Contributor Author

emackey commented Aug 14, 2019

No, the default wrapping value in glTF is REPEAT, so when not specified, repeat should be true.

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.

2 participants