Skip to content

NodeMaterial: Cleanup alphaTest #31147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2025
Merged

NodeMaterial: Cleanup alphaTest #31147

merged 4 commits into from
May 23, 2025

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented May 22, 2025

Related issue: #31127

Description

It maintains the logic of the previous PR but with some revisions.

@sunag sunag added this to the r177 milestone May 22, 2025
Copy link

github-actions bot commented May 22, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.26
78.64
337.26
78.64
+0 B
+0 B
WebGPU 550.64
152.68
550.68
152.69
+45 B
+10 B
WebGPU Nodes 549.99
152.53
550.03
152.54
+45 B
+10 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 468.12
113.14
468.12
113.14
+0 B
+0 B
WebGPU 625.95
169.45
626
169.46
+45 B
+11 B
WebGPU Nodes 580.8
158.77
580.85
158.79
+45 B
+17 B


diffuseColor.a.assign( 1.0 );

} else if ( alphaTestNode === null ) {

diffuseColor.a.lessThanEqual( 0 ).discard();
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 added this experimentally, to do alphaTest on non-opaque materials even if material.alphaTest is not greater than zero. It may help with performance, but if not we can remove it. /cc @Mugen87

@sunag sunag marked this pull request as ready for review May 23, 2025 18:53
@sunag sunag merged commit 8301152 into mrdoob:dev May 23, 2025
12 checks passed
@sunag sunag deleted the dev-cleanup-alphaTest branch May 23, 2025 18:53
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* NodeMaterial: Cleanup `alphaTest`

* cleanup

* cleanup

* cleanup
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* NodeMaterial: Cleanup `alphaTest`

* cleanup

* cleanup

* cleanup
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