Skip to content
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

TSL: Allow max()/min() to take an arbitrary number of arguments #30780

Merged
merged 2 commits into from
Mar 23, 2025

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Mar 23, 2025

Closes #28728

Description

Allow the max() and min() functions to take an arbitrary number of arguments.

material.colorNode = max( 0.0, .25, .5, .75, 1.0 ); // result will be 1.0

Copy link

github-actions bot commented Mar 23, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.08
78.29
336.08
78.29
+0 B
+0 B
WebGPU 526.26
146.63
526.44
146.68
+176 B
+52 B
WebGPU Nodes 525.73
146.52
525.91
146.58
+176 B
+52 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.15
112.18
+0 B
+0 B
WebGPU 598.46
162.66
598.64
162.71
+176 B
+56 B
WebGPU Nodes 553.54
152.12
553.72
152.18
+176 B
+56 B

@sunag sunag marked this pull request as ready for review March 23, 2025 04:06
@sunag sunag added this to the r175 milestone Mar 23, 2025
@sunag sunag merged commit beda0bb into mrdoob:dev Mar 23, 2025
12 checks passed
@sunag sunag deleted the dev-min-max branch March 23, 2025 04:30
@brunosimon
Copy link
Contributor

I needed this one so much

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.

TSL: Wrong compilation of min(...) and max(...) with 3 or more parameters
2 participants