|
|
@@ -19,6 +19,13 @@ export async function decompress( blitTexture, maxTextureSize = Infinity, render
|
|
|
}
|
|
|
|
|
|
const material = new NodeMaterial();
|
|
|
+
|
|
|
+ // disable uv transform
|
|
|
+ const currentTextureMatrix = blitTexture.matrix.clone();
|
|
|
+ const currentTextureMatrixAutoUpdate = blitTexture.matrixAutoUpdate;
|
|
|
+ blitTexture.matrix.identity();
|
|
|
+ blitTexture.matrixAutoUpdate = false;
|
|
|
+
|
|
|
material.fragmentNode = texture( blitTexture ).uv( uv().flipY() );
|
|
|
|
|
|
const width = Math.min( blitTexture.image.width, maxTextureSize );
|
|
|
@@ -58,6 +65,11 @@ export async function decompress( blitTexture, maxTextureSize = Infinity, render
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // restore
|
|
|
+
|
|
|
+ blitTexture.matrix.copy( currentTextureMatrix );
|
|
|
+ blitTexture.matrixAutoUpdate = currentTextureMatrixAutoUpdate;
|
|
|
+
|
|
|
return readableTexture;
|
|
|
|
|
|
}
|