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

reworked struct array example #30525

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Spiri0
Copy link
Contributor

@Spiri0 Spiri0 commented Feb 14, 2025

#30394 #30487

I recreated the PR because I had big problems with creating the screenshot and the branch was completely destroyed as a result. I was only able to create the screenshot with changes in puppeteer.js and the screenshot still doesn't fit.
The code itself works perfectly. @sunag you have a new node in mind for the structArray anyway. That's why I'm holding off on experimenting with screenshots for the moment

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.42
78.33
336.42
78.33
+0 B
+0 B
WebGPU 518.01
143.8
518.2
143.84
+188 B
+47 B
WebGPU Nodes 517.48
143.69
517.66
143.73
+188 B
+46 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.41
112.17
465.41
112.17
+0 B
+0 B
WebGPU 589.88
159.76
590.01
159.79
+122 B
+26 B
WebGPU Nodes 545.25
149.23
545.37
149.26
+122 B
+27 B

@Spiri0
Copy link
Contributor Author

Spiri0 commented Feb 18, 2025

@sunag Is there a way to update parts of a storageBufferAttribute from the CPU side?
The advantage of the CPU is that it can pre-calculate geometries with 64bit precision
That's my naive thought, but that doesn't work.

positionBuffer.array.set( instancePositions, instanceSlot * instancePositions.length );
positionBuffer.needsUpdate = true;

I also had an example with interleaved buffers in mind but that would be a bit more extensive.

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.

1 participant