WebGPURenderer: WebGL viewport / scissors not working correctly with PostProcessing#32883
Merged
sunag merged 2 commits intoJan 29, 2026
Conversation
…ing in WebGPURenderer
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Mugen87
reviewed
Jan 29, 2026
Mugen87
reviewed
Jan 29, 2026
Mugen87
approved these changes
Jan 29, 2026
Mugen87
left a comment
Collaborator
There was a problem hiding this comment.
I think scissor should be managed like viewport so this change looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed #32882
Description
When using
PostProcessingwith the WebGL backend (forceWebGL: true), viewport and scissor settings were incorrectly applied during nested render calls, causing rendered content to appear smaller than expected.Root cause: In WebGL, scissor state is global. When
PassNoderenders the scene to a render target (triggering a nestedrenderer.render()call), thebeginRendermethod didn't reset the scissor whenrenderContext.scissorwasfalse. This left the outer scissor active, causing the render target to only receive content within the outer scissor area.Fix in
WebGLBackend.js:In
beginRender: Added else clause to reset scissor to the full render area whenrenderContext.scissorisfalseIn
finishRender: Added scissor state restoration (matching the existing viewport restoration pattern)This ensures proper scissor state isolation between nested render calls, matching WebGPU's per-render-pass state model.