Skip to content

Renderer: Fix light invalidation by nested render calls.#33737

Merged
sunag merged 1 commit into
mrdoob:devfrom
Mugen87:dev8
Jun 7, 2026
Merged

Renderer: Fix light invalidation by nested render calls.#33737
sunag merged 1 commit into
mrdoob:devfrom
Mugen87:dev8

Conversation

@Mugen87

@Mugen87 Mugen87 commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Fixed #33730.

Description

The PR makes sure nested renderings do not invalidate the lights array that holds the lights of the scene. That can happen when the same scene is rendered with a camera that uses a different layers configuration. The nested pass will mutate the same shared lights array and never restore it.

Maintaining a simple stack mechanism in Lighting.js fixes that issue.

@Mugen87 Mugen87 added this to the r185 milestone Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 365.48
86.82
365.48
86.82
+0 B
+0 B
WebGPU 661.54
183.06
661.74
183.12
+196 B
+55 B
WebGPU Nodes 659.58
182.77
659.78
182.82
+196 B
+55 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 507.15
123.31
507.15
123.31
+0 B
+0 B
WebGPU 740.14
199.2
740.33
199.26
+196 B
+58 B
WebGPU Nodes 689.36
186.54
689.55
186.59
+196 B
+55 B

@sunag sunag merged commit 618d8ed into mrdoob:dev Jun 7, 2026
15 of 16 checks passed
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.

WebGPURenderer: InstancedMesh receiveShadow renders fully black when the light's shadow camera uses a non-default layer

2 participants