Skip to content

Conversation

Rtwo-Dtwo
Copy link
Contributor

@Rtwo-Dtwo Rtwo-Dtwo commented Jun 15, 2025

Description

Added an explicit property normalized to the GLBufferAttribute class declaration. The property is already evaluated by WebGLBindingStates and set as a parameter to the WebGL method vertexAttribPointer. If undefined it defaults to false, the user could already add the property to an instance of GLBufferAttribute. This PR makes the behavior more explicit.

The documentation and tests have been extended.

The webgl_buffergeometry_glbufferattribute example has been modified to make usage of the property for the color buffer. Additionally, the example screenshot has been updated prior to the changes.

Copy link

github-actions bot commented Jun 15, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.54
78.73
337.54
78.73
+0 B
+0 B
WebGPU 555.73
153.92
555.73
153.92
+0 B
+0 B
WebGPU Nodes 555.08
153.76
555.08
153.76
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 468.74
113.38
468.74
113.38
+0 B
+0 B
WebGPU 631.33
170.79
631.33
170.79
+0 B
+0 B
WebGPU Nodes 586.18
160.12
586.18
160.12
+0 B
+0 B

Update documentation and unit test.

Update doc
… for the color buffer

More efficient storage of colors in the GPU buffer and demonstration of the feature.
@Rtwo-Dtwo Rtwo-Dtwo force-pushed the glbufferattribute-normalized branch from 2ea4d69 to b4c7bdd Compare June 15, 2025 17:50
@Mugen87 Mugen87 added this to the r178 milestone Jun 16, 2025
@Mugen87 Mugen87 changed the title Add property normalized to GLBufferAttribute GLBufferAttribute: Add normalized property. Jun 16, 2025
@Mugen87 Mugen87 merged commit 8275091 into mrdoob:dev Jun 16, 2025
12 checks passed
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