Skip to content

Conversation

@WestLangley
Copy link
Collaborator

Set the proper clear color when using reversed depth.

@WestLangley WestLangley added this to the r179 milestone Jul 25, 2025
@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.22
78.88
338.29
78.89
+64 B
+4 B
WebGPU 560.72
155.17
560.72
155.17
+0 B
+0 B
WebGPU Nodes 559.64
154.96
559.64
154.96
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.49
113.56
469.56
113.56
+64 B
+6 B
WebGPU 635.72
172.04
635.72
172.04
+0 B
+0 B
WebGPU Nodes 590.37
161.29
590.37
161.29
+0 B
+0 B

@Mugen87 Mugen87 merged commit 09fa1fb into mrdoob:dev Jul 25, 2025
9 checks passed
@WestLangley WestLangley deleted the dev-shadowmap_reversed_depth branch July 25, 2025 14:44
_state.setBlending( NoBlending );
_state.buffers.color.setClear( 1, 1, 1, 1 );

if ( _state.buffers.depth.getReversed() ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would _state.buffers.depth.isReversed() be better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer to @Mugen87 on that. 🙏

Also, please consider the concerns I have about WebGLState.js mentioned in #31413.

Copy link
Collaborator

@Mugen87 Mugen87 Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is named getReversed() because there is setReversed(). So these methods represent getters and setters for an internal boolean reversed value.

Copy link
Owner

@mrdoob mrdoob Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so the check is meant to be:

if ( _state.buffers.depth.getReversed() === true ) {

I'll change it, I think it's easier to read that way.

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.

3 participants