Skip to content

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

Merged
sunag merged 2 commits into
mrdoob:devfrom
sunag:dev-min-max
Mar 23, 2025
Merged

TSL: Allow max()/min() to take an arbitrary number of arguments#30780
sunag merged 2 commits into
mrdoob:devfrom
sunag:dev-min-max

Conversation

@sunag

@sunag sunag commented Mar 23, 2025

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Mar 23, 2025

Copy link
Copy Markdown

📦 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
@sunag sunag deleted the dev-min-max branch March 23, 2025 04:30
@brunosimon

Copy link
Copy Markdown
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