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

USDZExporter: export from compressed texture data #23321 #27382

Merged
merged 6 commits into from
Dec 15, 2023
7 changes: 3 additions & 4 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,11 @@ class USDZExporter {

let texture = textures[ id ];

// make non-readable textures (e.g. CompressedTexture) readable by blitting them into a new texture
if ( texture instanceof THREE.CompressedTexture ) {
if ( texture.isCompressedTexture === true ) {

texture = decompress( texture, Infinity );
texture = decompress( texture, Infinity );

}
}

const canvas = imageToCanvas( texture.image, texture.flipY );
const blob = await new Promise( resolve => canvas.toBlob( resolve, 'image/png', 1 ) );
Expand Down