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

ComputeNode: Fix usage (much more particles) #23944

Merged
merged 4 commits into from
Apr 26, 2022
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Apr 25, 2022

Related issue: #23905

Description

The previous approach does not multiply the number of elements by workgroupSize, now we can compute huge arrays.
I updated webgpu_compute example and change the behavior of ComputeNode.

webgpu_compute now work with, 300.000 particles.

--
I created a small internal example computing vertices(position) above 16-bits and everything worked ok with ComputeNode.

three.js.examples.-.Google.Chrome.2022-04-25.18-42-51.mp4

This contribution is funded by Google via Igalia

@sunag sunag added this to the r140 milestone Apr 25, 2022
@mrdoob mrdoob merged commit 814b0b2 into mrdoob:dev Apr 26, 2022
@mrdoob
Copy link
Owner

mrdoob commented Apr 26, 2022

Thanks!

Comment on lines +135 to +136
mesh.isInstancedMesh = true;
mesh.count = particleNum;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... Someday we'll have to figure out how to make a better abstraction for instancing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in something like this: #23835 (comment)

const instancedObj3d = new InstanceObject3D( mesh || sprite3d || skinnedMesh, instanceCount );
instancedObj3d.target; // mesh || sprite3d || skinnedMesh
instancedObj3d.count; // instanceCount 

scene.add( instancedObj3d  );

@sunag sunag deleted the dev-compute-fix branch April 26, 2022 02:49
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* ComputeNode: Fix usage

* cleanup

* cleanup

* fix const to let
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