Skip to content

GLTFExporter grows files 5x from import #23587

@elalish

Description

@elalish

Describe the bug

JPEG textures in an input GLB get exported as PNG, causing such models to grow enormously in size.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://threejs.org/editor/
  2. Import DamagedHelment.glb
  3. Export as GLB
  4. Note the original was 3.8 Mb, while the new is 17.9 Mb

Expected behavior

The exported model should be pretty close to the same size as the original. I understand it won't be identical, which is fine, but this is pretty unusable.

Cause

#23385 is sort of the culprit, but really it was #23228 where the RGBFormat was removed and this was the only way we had to tell if a texture had been a JPG or a PNG. @Mugen87 @donmccurdy This is blocking model-viewer's update to r137/r138 because it affects our editor the same as yours. Can anyone think of a quick work-around?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions