Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Nov 12, 2025

Related issue: #32243

Description

Add update range for bindings and for the BufferNode.
This could also be used to optimize NodeUniformsGroup, although it was not implemented in this PR.

const count = 8;

const array = new Float32Array( count * 4 );
array.set( [ 1, 0, 0, 1 ] ); // red

const bufferArray = buffer( array, 'vec4', count ).setGroup( renderGroup );

const material = new THREE.NodeMaterial();
material.colorNode = bufferArray.element( 0 );

// loop

bufferArray.addUpdateRange( 0, 4 ); // update just this range

@sunag sunag added this to the r182 milestone Nov 12, 2025
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.24
86.48
356.24
86.48
+0 B
+0 B
WebGPU 613.68
172.23
614.89
172.56
+1.22 kB
+339 B
WebGPU Nodes 612.28
171.97
613.5
172.31
+1.22 kB
+346 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.04
121.25
488.04
121.25
+0 B
+0 B
WebGPU 683.1
187.49
684.36
187.83
+1.27 kB
+349 B
WebGPU Nodes 624.82
170.72
626.09
171.04
+1.27 kB
+315 B

@sunag sunag marked this pull request as ready for review November 12, 2025 02:34
@sunag sunag merged commit 7b664f5 into mrdoob:dev Nov 13, 2025
10 checks passed
@sunag sunag deleted the dev-update-ranges branch November 13, 2025 14:28
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.

2 participants