Skip to content

WebGLRenderer: Correctly init default depth textures. - #34687

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2
Sep 28, 2026
Merged

Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87

@Mugen87 Mugen87 commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Related issue: #34683

Description

WebGLRenderer does not correctly initializes its fallback depth textures. The PR fixes that by:

  • Adding initShadowTexture() that inits the texture. It must be done lazily and not at construction time to avoid breaking tree-shaking.
  • Removes isReversedDepthBuffer() since a distinction between reversed/non-reversed is not required. An empty depth texture should pass any depth test so using AlwaysCompare works for both depth modes.
  • The PR also adds a fallback for CubeDepthTexture to fix point lights.

@Mugen87 Mugen87 added this to the r187 milestone Sep 28, 2026
@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
Core 389.94
102.28
389.94
102.28
+0 B
+0 B
WebGL 372.66
87.15
372.73
87.14
+71 B
-4 B
WebGPU 427.77
115.15
427.77
115.15
+0 B
+0 B
WebGPU Nodes 715.43
196.5
715.43
196.5
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 517.29
124.25
517.36
124.25
+70 B
-4 B
WebGPU 768.97
206.05
768.97
206.05
+0 B
+0 B
WebGPU Nodes 714.82
192.56
714.82
192.56
+0 B
+0 B

@Mugen87
Mugen87 merged commit 9be9ac9 into mrdoob:dev Sep 28, 2026
10 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.

1 participant