Skip to content

GLSLNodeBuilder: Fix CubeDepthTexture sampler.#32857

Merged
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev2
Jan 27, 2026
Merged

GLSLNodeBuilder: Fix CubeDepthTexture sampler.#32857
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 26, 2026

Related issue: #32801

Description

While trying to port the godrays effect from #32801 to TSL, I've realized a number of issues. One of them is fixed by this PR.

GLSLNodeBuilder currently assumes an instance of CubeDepthTexture is always sampled with samplerCubeShadow. However, this sampler type is only compatible when depth comparison is enabled. If you just want to access the raw depth (so when texture.compareFunction = null), you must use samplerCube.

Interestingly, WGSL allows to use texture_depth_cube() (and texture_depth_2d()) without the use of a comparison sampler. So a similar change isn't required for WebGPU.

@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 357.49
84.84
357.49
84.84
+0 B
+0 B
WebGPU 622.01
172.8
622.06
172.81
+55 B
+7 B
WebGPU Nodes 620.61
172.56
620.67
172.57
+55 B
+8 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 490.47
119.9
490.47
119.9
+0 B
+0 B
WebGPU 693.12
188.09
693.17
188.1
+55 B
+13 B
WebGPU Nodes 642.5
175.19
642.56
175.2
+55 B
+10 B

@Mugen87 Mugen87 added this to the r183 milestone Jan 26, 2026
@Mugen87 Mugen87 merged commit f67c8e4 into mrdoob:dev Jan 27, 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