From 9d40465f25fc2450f19d1eafff11988d5ad0a0fd Mon Sep 17 00:00:00 2001 From: Tobias <124624771+TobiasNoell@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:32:41 +0100 Subject: [PATCH 1/2] Fix: WebGL viewport / scissors not working correctly with PostProcessing in WebGPURenderer (#32883) --- src/renderers/webgl-fallback/WebGLBackend.js | 32 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/renderers/webgl-fallback/WebGLBackend.js b/src/renderers/webgl-fallback/WebGLBackend.js index 61aa4684be470a..5e999c6fa5e940 100644 --- a/src/renderers/webgl-fallback/WebGLBackend.js +++ b/src/renderers/webgl-fallback/WebGLBackend.js @@ -446,9 +446,12 @@ class WebGLBackend extends Backend { if ( renderContext.scissor ) { - const { x, y, width, height } = renderContext.scissorValue; + this.updateScissor( renderContext ); - state.scissor( x, renderContext.height - height - y, width, height ); + } else { + + const { width, height } = this.getDrawingBufferSize(); + state.scissor( 0, 0, width, height ); } @@ -545,6 +548,17 @@ class WebGLBackend extends Backend { } + if ( previousContext.scissor ) { + + this.updateScissor( previousContext ); + + } else { + + const { width, height } = this.getDrawingBufferSize(); + state.scissor( 0, 0, width, height ); + + } + } this.prepareTimestampBuffer( TimestampQuery.RENDER, this.getTimestampUID( renderContext ) ); @@ -646,6 +660,20 @@ class WebGLBackend extends Backend { } + /** + * Updates the scissor with the values from the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + updateScissor( renderContext ) { + + const { state } = this; + const { x, y, width, height } = renderContext.scissorValue; + + state.scissor( x, renderContext.height - height - y, width, height ); + + } + /** * Defines the scissor test. * From d167b69e3c0b7157ac96ca9eda3c5a0c351cfa2b Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Thu, 29 Jan 2026 20:14:15 +0100 Subject: [PATCH 2/2] Update webgpu_postprocessing_godrays.html Update light color to make WebGL demo. --- examples/webgpu_postprocessing_godrays.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webgpu_postprocessing_godrays.html b/examples/webgpu_postprocessing_godrays.html index 385bf887d4b6e5..ca35c0be57b013 100644 --- a/examples/webgpu_postprocessing_godrays.html +++ b/examples/webgpu_postprocessing_godrays.html @@ -89,7 +89,7 @@ scene.add( new THREE.AmbientLight( 0xcccccc, 0.4 ) ); - const pointLight = new THREE.PointLight( 0xffffff, 10000 ); + const pointLight = new THREE.PointLight( 0xf6287d, 10000 ); pointLight.castShadow = true; pointLight.shadow.bias = - 0.00001; pointLight.shadow.mapSize.width = 2048;