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

poor performance with some gltf files #21819

Closed
makc opened this issue May 12, 2021 · 3 comments · Fixed by #21821
Closed

poor performance with some gltf files #21819

makc opened this issue May 12, 2021 · 3 comments · Fixed by #21821

Comments

@makc
Copy link
Contributor

makc commented May 12, 2021

so this file here has some 120K tris and 3 x 2K textures, however when I drop it into 3js editor fps goes out the window. I get much better performance in https://sandbox.babylonjs.com/ with the same model.

@donmccurdy could it be related to the fact that, for some reason, 3js loader duplicates the textures for each map in every material across the model? here, we have 4 identical materials with 5 maps, 3 of them being same texture, but 3js creates 20 textures for this:
Screen Shot 2021-05-12 at 16 06 17
Screen Shot 2021-05-12 at 16 06 36

glb file in zip below:
three_js_problem_model.glb.zip

@mrdoob
Copy link
Owner

mrdoob commented May 12, 2021

Does performance goes out of the window when dropping it in https://model-viewer-tester.glitch.me/?

@donmccurdy
Copy link
Collaborator

There's a minor issue in this file where each texture defines a KHR_texture_transform extension, containing only a redundant texCoord index:

"texCoord": 0,
"extensions": {
  "KHR_texture_transform": {
    "texCoord": 0
  }
}

Normally that extension is supposed to define a transform (offset, rotation, scale) and so we preemptively clone the texture, but in this case the extension is doing nothing. @makc would you be able to report this to the babylon.js 3DS Max exporter with the source file if possible? It'd be great if they could omit this extension where it isn't actually used.

In the meantime #21821 should work around the issue here.

@makc
Copy link
Contributor Author

makc commented May 12, 2021

@mrdoob it does (
@donmccurdy nice, thanks!

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