DEV Community

Cover image for How to Compress .glb File to Draco Compressed Format
ANDGOEDU
ANDGOEDU

Posted on

4 1 1

How to Compress .glb File to Draco Compressed Format

Steps

  1. Compress GLB File to Draco Compressed Format Using optimizeglb.com

  2. View Compressed Draco Files at 3dpea.com

  3. Add Relevant Code to ThreeJS

import { GLTFLoader } from 'https://cdn.skypack.dev/three@0.136.0/examples/jsm/loaders/GLTFLoader.js';
import { DRACOLoader } from 'https://cdn.skypack.dev/three@0.136.0/examples/jsm/loaders/DRACOLoader.js';

const draco = new DRACOLoader();
draco.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/');

const loader = new GLTFLoader(); // ADD DracoLoader to your Existing Loader 
loader.setDRACOLoader(draco);
Enter fullscreen mode Exit fullscreen mode
  1. Replace Your Current 3D GLB File with Compressed Draco Format

  2. Enjoy 90% Less in terms of The 3D File Size.

References

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay