Skip to content

Client-Side Draco Compression Fails on GLB Files Containing WebP Textures #1559

Answered by donmccurdy
canberka asked this question in Q&A
Discussion options

You must be logged in to vote

@canberka the WebP extension shouldn't make a difference for Draco, here's an example on JSFiddle:

https://jsfiddle.net/donmccurdy/ho7b8ywf/

Note that rather than adding extensions manually it's better to use functions. Adding the WebP extension alone does nothing, you also have to compress the textures. For example, this will add the extensions to the Document for you, and make any other changes required:

import { draco, textureCompress } from '@gltf-transform/functions';

await document.transform(
  draco(),
  textureCompress({ targetFormat: 'webp', resize: [1024, 1024] })
);

Also, I would recommend installing glTF Transform with npm/yarn/pnpm. You'll run into other issues trying to use…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@canberka
Comment options

Answer selected by canberka
Comment options

You must be logged in to vote
4 replies
@elalish
Comment options

@canberka
Comment options

@elalish
Comment options

@donmccurdy
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #1558 on November 13, 2024 22:31.