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

Examples: Add glTF compression example #21114

Merged
merged 1 commit into from
Jan 20, 2021
Merged

Examples: Add glTF compression example #21114

merged 1 commit into from
Jan 20, 2021

Conversation

zeux
Copy link
Contributor

@zeux zeux commented Jan 20, 2021

ToyCar.glb is exported from glTF-Sample-Models using gltfpack with
geometry compression via EXT_meshopt_compression and texture compression
via KHR_texture_basisu (using UASTC+zstd since ETC1S creates very
visible reflection artefacts).

The resulting .glb file is 1.9 MB, compared to original 6.9 MB; in the
resulting file, geometry takes 0.6 MB and textures take 1.3 MB; this is
compared to the original 3.5 MB of geometry and 3.4 MB of textures.

Fixes #21111

@zeux
Copy link
Contributor Author

zeux commented Jan 20, 2021

This is how the scene looks like:

image

Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Two comments, otherwise looks good to me.

examples/webgl_loader_gltf_compressed.html Outdated Show resolved Hide resolved
examples/webgl_loader_gltf_compressed.html Outdated Show resolved Hide resolved
coffeemat.glb is exported from the source Sketchfab scene using gltfpack
with geometry compression via EXT_meshopt_compression and texture compression
via KHR_texture_basisu (using ETC1S/BasisLZ).

The source scene has 12 MB of geometry and 22 MB of texture data.
The compressed scene has 2 MB of geometry and 2.6 MB of texture data.
@zeux
Copy link
Contributor Author

zeux commented Jan 20, 2021

Replaced the scene with https://sketchfab.com/3d-models/coffeemat-7fb196a40a6e4697aad9ca2f75c8b33d:

image

The source scene has 12 MB of geometry and 22 MB of texture data.
The compressed scene has 2 MB of geometry and 2.6 MB of texture data (using ETC1S).

I've also squashed the commits to make sure the old .glb doesn't pollute the history.

@mrdoob mrdoob added this to the r125 milestone Jan 20, 2021
@mrdoob mrdoob merged commit 214135b into mrdoob:dev Jan 20, 2021
@mrdoob
Copy link
Owner

mrdoob commented Jan 20, 2021

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Jan 22, 2021

I have simplified the example a bit: 067cf15

http://raw.githack.com/mrdoob/three.js/dev/examples/webgl_loader_gltf_compressed.html

@zeux zeux deleted the gltf-compressed branch January 23, 2021 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLTFLoader: Add an example for EXT_meshopt_compression
3 participants