Skip to content

WebGPURenderer: Reaaply align of frontFace and fix FrontFacingNode#31784

Merged
sunag merged 3 commits into
mrdoob:devfrom
sunag:dev-frontFace
Aug 31, 2025
Merged

WebGPURenderer: Reaaply align of frontFace and fix FrontFacingNode#31784
sunag merged 3 commits into
mrdoob:devfrom
sunag:dev-frontFace

Conversation

@sunag

@sunag sunag commented Aug 29, 2025

Copy link
Copy Markdown
Collaborator

Fixes: #31764
Related issue: #31769

Description

@mrdoob told me just now that the release will be published on monday, if it passes the @WestLangley tests, I would go back and merge it into this release if you agree.

I just reapplied the @Mugen87 PR and fixed the FrontFacingNode.

Example
https://jsfiddle.net/vjgan6xh/1/

import { frontFacing, color, select } from 'three/tsl';

// short code simple to test
tubeBottom.material.colorNode = select( frontFacing, color( 0xff0000 ), color( 0x00ff00 ) );
tubeTop.material.colorNode = select( frontFacing, color( 0x0000ff ), color( 0x00ff00 ) );

@sunag sunag marked this pull request as ready for review August 29, 2025 13:29
@github-actions

github-actions Bot commented Aug 29, 2025

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.91
79.11
338.91
79.11
+0 B
+0 B
WebGPU 579.35
159.66
579.25
159.66
-106 B
+6 B
WebGPU Nodes 577.96
159.41
577.85
159.42
-106 B
+7 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 470.78
113.9
470.78
113.9
+0 B
+0 B
WebGPU 649.5
175.53
649.4
175.53
-106 B
+7 B
WebGPU Nodes 603.6
164.67
603.49
164.68
-106 B
+10 B

@Mugen87

Mugen87 commented Aug 31, 2025

Copy link
Copy Markdown
Collaborator

@sunag If @WestLangley does not respond in time, I would suggest to merge the PR for 180 since it's an improvement over the status quo. Both backends now consistently respond to the scene setup. And the logic is in line with WebGLRenderer.

@sunag sunag added this to the r180 milestone Aug 31, 2025
@sunag sunag merged commit 47aaa53 into mrdoob:dev Aug 31, 2025
9 checks passed
@sunag sunag deleted the dev-frontFace branch August 31, 2025 12:49
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.

WebGPU: Negative scale inverts front-face direction

2 participants