From eed76ef5329cb6472e1b62f7dcf603f2102b938e Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Wed, 29 Jan 2025 10:10:57 +0100 Subject: [PATCH] WebGLBackend: Fix depth formats. --- src/renderers/webgl-fallback/utils/WebGLTextureUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js b/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js index 58ebe94457c503..da2ce50ac33f6c 100644 --- a/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +++ b/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js @@ -261,7 +261,8 @@ class WebGLTextureUtils { if ( glFormat === gl.DEPTH_COMPONENT ) { - if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.DEPTH24_STENCIL8; + if ( glType === gl.UNSIGNED_SHORT ) internalFormat = gl.DEPTH_COMPONENT16; + if ( glType === gl.UNSIGNED_INT ) internalFormat = gl.DEPTH_COMPONENT24; if ( glType === gl.FLOAT ) internalFormat = gl.DEPTH_COMPONENT32F; }