Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Mar 26, 2025

Closes: #28569

Description

Add support for booleans in Loop, to support while().

material.colorNode = Fn( () => {

	const value = float( 0 ).toVar();

	Loop( value.lessThan( 1 ), () => {

		value.addAssign( .1 );

	} );

	return value;

} )();

@sunag sunag added this to the r175 milestone Mar 26, 2025
@github-actions
Copy link

📦 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 531.07
147.55
531.16
147.58
+87 B
+33 B
WebGPU Nodes 530.54
147.44
530.63
147.48
+87 B
+33 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 602.77
163.53
602.86
163.57
+87 B
+39 B
WebGPU Nodes 557.81
152.97
557.89
153.01
+87 B
+40 B

@sunag sunag marked this pull request as ready for review March 26, 2025 19:51
@sunag sunag changed the title TSL: Add while in Loop() TSL: Add while to Loop() Mar 26, 2025
@sunag sunag merged commit 2e3ee1c into mrdoob:dev Mar 26, 2025
12 checks passed
@sunag sunag deleted the dev-while branch March 26, 2025 21:38
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: Missing While Support

1 participant