Skip to content

Commit

Permalink
USDZExporter: export from compressed texture data mrdoob#23321 (mrdoo…
Browse files Browse the repository at this point in the history
…b#27382)

* USDZExporter: export from compressed texture data mrdoob#23321

* add screenshot, update files.json

* Update USDZExporter.js

Clean up.

* remove usdz compressed example

* Update USDZExporter.js

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
2 people authored and AdaRoseCannon committed Jan 15, 2024
1 parent b2c5c6b commit b5469b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as THREE from 'three';
import * as fflate from '../libs/fflate.module.js';
import { decompress } from './../utils/TextureUtils.js';

class USDZExporter {

Expand Down Expand Up @@ -76,7 +77,13 @@ class USDZExporter {

for ( const id in textures ) {

const texture = textures[ id ];
let texture = textures[ id ];

if ( texture.isCompressedTexture === true ) {

texture = decompress( texture );

}

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

0 comments on commit b5469b1

Please sign in to comment.