Skip to content

Restore stencil buffer for the shared 3D renderer - #9253

Merged
4ian merged 1 commit into
4ian:masterfrom
snowyukitty:fix/restore-three-stencil-buffer
Oct 19, 2026
Merged

4ian merged 1 commit into
4ian:masterfrom
snowyukitty:fix/restore-three-stencil-buffer

Conversation

@snowyukitty

Copy link
Copy Markdown
Contributor

Fixes #9252.

Request a stencil buffer when creating the Three.js renderer shared with PixiJS. Three.js now defaults stencil to false, so stencil-tested materials can draw outside their masks.

Adds real WebGL browser regressions with antialiasing disabled and with MSAA: verify the shared context, then render a half-screen stencil mask and check both masked and unmasked pixels. Turning off stencil testing also verifies that the previously masked pixel can be drawn.

Validation from the repository root (Linux, Node 24.16.0, Chromium 149 / SwiftShader):

npm run build --prefix GDJS
npm run check-types --prefix GDJS
npm run check-format --prefix GDJS
npm run generate-doc --prefix GDJS
npm run test:chromeHeadlessNoSandbox --prefix GDJS/tests -- --reporters dots

1,405 tests pass; 29 are skipped. All four new regression cases fail on the unmodified production code and pass with the fix. Chrome uses --disable-dev-shm-usage in Docker. Native desktop/mobile applications were not run.

Related constructor work: #7400 (PixiJS 8) and #9087 (rendering resolution). This patch adds only the stencil option to the current renderer.

@snowyukitty
snowyukitty requested a review from 4ian as a code owner October 16, 2026 07:31
@4ian
4ian merged commit 4991864 into 4ian:master Oct 19, 2026
3 checks passed
@4ian

4ian commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3D: WebGL renderer created without stencil buffer since Three.js 0.185.1 upgrade

3 participants