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: Add matrix operations support for floats #30370

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

RenaudRohlinger
Copy link
Collaborator

Description

Currently the NodeBuilder doesn't support any operation on matrix.
Before this PR:

const a = float(2).toConst('a') 
const b = mat3().toConst('b') 
const c = a.mul(b).toConst('c');
// let c = b(a); // <-- error

After this PR:

const a = float(2).toConst('a') 
const b = mat3().toConst('b') 
const c = a.mul(b).toConst('c');
// let c = a * c; // <-- ok

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger added this to the r173 milestone Jan 21, 2025
Copy link

github-actions bot commented Jan 21, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.25
78.28
336.25
78.28
+0 B
+0 B
WebGPU 506.2
140.52
506.52
140.59
+322 B
+67 B
WebGPU Nodes 505.67
140.41
505.99
140.48
+322 B
+68 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.25
112.13
465.25
112.13
+0 B
+0 B
WebGPU 580.19
157.22
580.51
157.28
+322 B
+65 B
WebGPU Nodes 535.57
146.79
535.89
146.85
+322 B
+68 B

@sunag sunag merged commit 7bc5b17 into mrdoob:dev Jan 21, 2025
12 checks passed
@sunag
Copy link
Collaborator

sunag commented Jan 21, 2025

I don't know if the description is completely correct, operations with matrices and vectors were already supported, we now have support for flots.

@sunag sunag changed the title TSL: Add matrix operations support TSL: Add matrix operations support for floats Jan 21, 2025
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.

3 participants