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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay