Skip to content

Conversation

@haxiomic
Copy link
Contributor

@haxiomic haxiomic commented Mar 26, 2025

Fixes #30808

See #29579 (comment)

reverseDepthBuffer: true has been broken since r170

The problem is in WebGLState.setReversed(), code within the function assumes the value of the variable reversed is set, but it is not set until the end of the function

Also adds the example that @CodyJasonBennett wrote originally, closing #29765 and acting as a regression test

Screenshot 2025-03-26 at 23 38 06

@haxiomic haxiomic marked this pull request as ready for review March 26, 2025 21:02
@haxiomic
Copy link
Contributor Author

CC @CodyJasonBennett

@github-actions
Copy link

github-actions bot commented Mar 26, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.08
78.29
336.08
78.29
+1 B
+1 B
WebGPU 532.63
148
532.63
148
+0 B
+0 B
WebGPU Nodes 532.1
147.9
532.1
147.9
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.15
112.18
465.16
112.18
+1 B
+2 B
WebGPU 604.33
164.01
604.33
164.01
+0 B
+0 B
WebGPU Nodes 559.37
153.45
559.37
153.45
+0 B
+0 B

@haxiomic
Copy link
Contributor Author

haxiomic commented Mar 27, 2025

Added warning

Screenshot 2025-03-27 at 13 17 59

@Mugen87 Mugen87 added this to the r175 milestone Mar 27, 2025
@Mugen87 Mugen87 merged commit 818a279 into mrdoob:dev Mar 27, 2025
11 of 12 checks passed
@Mugen87 Mugen87 changed the title Fix setReversed() so reverseDepthBuffer: true works WebGLRenderer: Fix setReversed() so reverseDepthBuffer: true works. Mar 27, 2025
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.

reverseDepthBuffer: true broken since r170 (works in r169)

4 participants