Add external particle life sample#548
Merged
greggman merged 2 commits intowebgpu:mainfrom Dec 12, 2025
Merged
Conversation
kainino0x
approved these changes
Dec 12, 2025
Collaborator
kainino0x
left a comment
There was a problem hiding this comment.
This is a very fun sample! I agree the algorithms involved here seem interesting so they'll be useful learning materials. LGTM but let me add one more reviewer in case there's anything I didn't think of.
greggman
approved these changes
Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a sample showing a particle life simulation that runs on WebGPU. It uses spatial partitioning with atomic linked lists / counting sort to achieve larger numbers of particles.
The sample code itself has become quite large (it's around 2000 lines spread across multiple files and folders). So it's probably better as an external sample.
The reason i'm submitting this as a sample is because the simulation itself does use atomic linked lists and counting sort in an applied context to do spatial partitioning allowing for the simulation to avoid n^2 computations improving performance. This property of the sample could potentially make it a useful resource to others looking to develop their own simulations that involve spatial partitioning or particles.
I'm happy to make any changes that may be needed to contribute.
Please let me know whether this sample is appropriate for inclusion.
External sample: https://gpu-life.silverspace.io?sample
Repository: https://github.com/SilverSpace505/gpu-life