mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.3k stars 35.35k forks source link

GLTFLoader: Add an example for `EXT_meshopt_compression` #21111

Closed donmccurdy closed 3 years ago

donmccurdy commented 3 years ago

Since https://github.com/mrdoob/three.js/pull/20508 by @zeux, we've had support for using the EXT_meshopt_compression extension in GLTFLoader. We don't yet have any examples of how to use that, and I think it would be helpful to show (context thread on twitter).

zeux commented 3 years ago

I can contribute an example, I had a tweaked version of the original GLTF loader example when I was testing the PR.

donmccurdy commented 3 years ago

That'd be great, thank you! I think my suggestion would be to make a separate standalone example rather than rolling it into loader / gltf / extensions. That example is probably already doing too much.

Perhaps name it loader / gltf / compression for now, and we can extend it later to also include .ktx2 Basis compressed textures.

wallabyway commented 2 years ago

Here's an example of MeshOpt working with the USDz exporter for Quicklook: https://github.com/wallabyway/quicklook-example

The coffeeCart example looks good with it's metallic reflections, which work well with QuickLook's real-time IBL approximation. I used glTFPack which merged and compressed the meshes, bringing down the draw calls to just 2. So the performance under quicklook is very smooth.