-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Examples - Update Compute Rain to use computeIndirect #32170
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
This example used to work in Firefox since it worked with WebGL as well. This is not true anymore, the example now badly flickers. I would prefer to keep some of the compute examples compatible for WebGL as well. A lot of them are already WebGPU exclusive. |
…liant in both WebGLBackend and WebGPUBackend
Resolved by putting the count variable back and explaining why count still needs to be provided even when indirect compute is used. |
|
Nevermind the warning already accounts for this behavior. Perhaps the warning can be modified to indicate to the user that the code will default to the computeNode.count value. |
…or is already accounted for by warning
|
IMO, it is not required to include Edit: I'm okay with #32176 (since it's already WebGPU only) but I would leave the rain example as it is. |
Was just about to ask about fluid, so that's fine by me. Will close this PR. |
Related issue: #31488
Description
Updates webgpu_compute_particles_rain to use indirect compute functionality. Instead of always dispatching the maximum number of particles, we only dispatch enough workgroups to handle the number of rendered particles.
Currently, I'm updating the indirect buffer with a uniform, but let me know if there's a better method.