Skip to content

Commit 20ce0ce

Browse files
authored
WebGPUTextureUtils: Disable uv transform. (#29680)
1 parent cef0049 commit 20ce0ce

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/jsm/utils/WebGPUTextureUtils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ export async function decompress( blitTexture, maxTextureSize = Infinity, render
1919
}
2020

2121
const material = new NodeMaterial();
22+
23+
// disable uv transform
24+
const currentTextureMatrix = blitTexture.matrix.clone();
25+
const currentTextureMatrixAutoUpdate = blitTexture.matrixAutoUpdate;
26+
blitTexture.matrix.identity();
27+
blitTexture.matrixAutoUpdate = false;
28+
2229
material.fragmentNode = texture( blitTexture ).uv( uv().flipY() );
2330

2431
const width = Math.min( blitTexture.image.width, maxTextureSize );
@@ -58,6 +65,11 @@ export async function decompress( blitTexture, maxTextureSize = Infinity, render
5865

5966
}
6067

68+
// restore
69+
70+
blitTexture.matrix.copy( currentTextureMatrix );
71+
blitTexture.matrixAutoUpdate = currentTextureMatrixAutoUpdate;
72+
6173
return readableTexture;
6274

6375
}

0 commit comments

Comments
 (0)