Skip to content

Commit

Permalink
fix level mipmap and support compressed tex (mrdoob#27313)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenaudRohlinger authored and AdaRoseCannon committed Jan 15, 2024
1 parent 5c8ad4b commit dabd185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ class WebGLRenderer {
textures.setTexture3D( dstTexture, 0 );
glTarget = _gl.TEXTURE_3D;

} else if ( dstTexture.isDataArrayTexture ) {
} else if ( dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture ) {

textures.setTexture2DArray( dstTexture, 0 );
glTarget = _gl.TEXTURE_2D_ARRAY;
Expand All @@ -2467,7 +2467,7 @@ class WebGLRenderer {
const unpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );
const unpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );

const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ 0 ] : srcTexture.image;
const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;

_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );
_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );
Expand Down

0 comments on commit dabd185

Please sign in to comment.