question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GLTFExporter output file size regression

See original GitHub issue

Describe the bug

Importing a glTF with jpeg textures and reexporting it is now causing a major bloat in file size compared to the original (~2.5x for DamagedHelmet). I’m pretty sure this is due to https://github.com/mrdoob/three.js/pull/23857, as we’re now using the convertToBlob method of OffscreenCanvas instead of the toBlob method of Canvas. This feels like it might also be a Chrome bug? It is correctly outputting JPEGs of the proper dimensions, they are just much larger, like the quality setting is defaulting to something a lot higher than the usual 0.85. @donmccurdy @robertlong Thoughts? Our regression tests caught this in <model-viewer> when I tried to upgrade.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the model-viewer editor and select DamagedHelmet
  2. Click on “Download Scene”
  3. Open the zip and inspect DamagedHelmet.glb - note it is now 9.3MB

Expected behavior

The GLB should be ~4MB, similar to the 3.8MB original

Screenshots

If applicable, add screenshots to help explain your problem (drag and drop the image).

Platform:

  • Device: Desktop
  • OS: MacOS
  • Browser: Chrome
  • Three.js version: r140

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
robertlongcommented, May 3, 2022

It looks like Blink has a default JPEG quality of 92% and default WebP quality of 80%. And yeah for some reason this default quality is not being used when using convertToBlob. I can go ahead and use those defaults for those mimetypes if that makes sense? OffscreenCanvas really is only supported in Blink-powered engines right now and those defaults seem like good defaults for us to use for now.

0reactions
elalishcommented, May 3, 2022

Have you filed this issue on Chrome?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jpeg textures on export binary and embedImages=false cause ...
Heya, when exporting a material with a jpeg texture as a .glb with these options: { binary: true, embedImages: false } The resulting...
Read more >
THREE.GLTFExporter causing huge size difference - Questions
I am trying to implement an export as gltf option currently but I noticed that the exported gltf or glb file is much...
Read more >
High-volume .bin file in gltf output - Babylon.js Forum
I use babylon.js to export gltf files but after outputting the .bin file is saved in high volume, please help me faster ,...
Read more >
T93929 Error while exporting gltf in Blender 3.0
This happen as soon as I change something in the scene and try to export it, this error appears. A second try exports...
Read more >
class GLTFExporter | Simplygon 9 Documentation
Textures and binary blob files for glTF export will be placed alongside the glTF file and have names prefixed by the output file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found