-
-
Notifications
You must be signed in to change notification settings - Fork 42
docs: Jump flood algorithm example #1952
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
base: main
Are you sure you want to change the base?
Conversation
|
pkg.pr.new packages benchmark commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new example demonstrating the Jump Flood Algorithm, a GPU-accelerated algorithm for computing Voronoi diagrams. The example showcases compute shaders with ping-pong buffers and animated step visualization, serving as an educational resource for GPU algorithm implementations.
Key changes:
- Adds a complete Jump Flood Algorithm example with interactive controls for seed density, step delay, and range
- Updates numeric.ts to use type-only import for Snippet, aligning with codebase conventions
- Includes comprehensive test coverage with shader code validation
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/typegpu-docs/src/examples/algorithms/jump-flood/index.ts | Main implementation with initialization, flood computation, and rendering pipelines |
| apps/typegpu-docs/src/examples/algorithms/jump-flood/meta.json | Example metadata defining title, category, and tags |
| apps/typegpu-docs/src/examples/algorithms/jump-flood/index.html | Minimal HTML template with canvas element |
| packages/typegpu/tests/examples/individual/jump-flood.test.ts | Test suite validating shader code generation with snapshot testing |
| packages/typegpu/src/std/numeric.ts | Import statement updated to use type-only import for Snippet |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aleksanderkatan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great example! 🥐🍦
| initial: 0.1, | ||
| min: 0.001, | ||
| max: 5, | ||
| step: 0.001, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could do this a select? It's really difficult to select values smaller than 0.1, and those are interesting as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it will be just as hard if we just do 2 of them - how many would you like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0f2cdc3 to
0b45553
Compare

It's pretty - next step is to use it to create an outline around a 3d object in a scene 😉