feat: Attractors example#1949
Conversation
|
pkg.pr.new packages benchmark commit |
There was a problem hiding this comment.
Pull request overview
This PR adds a new Three.js example demonstrating GPU compute-based particle simulation with multiple attractors. The example is based on the Three.js TSL compute attractors particles example and showcases integration between TypeGPU and Three.js for compute shaders, implementing gravitational attraction and spinning forces on a large number of particles (262,144 particles).
Key Changes:
- Implements a GPU-accelerated particle system with customizable attractor physics
- Provides interactive controls for manipulating attractors using Three.js TransformControls
- Includes extensive UI controls for adjusting simulation parameters in real-time
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/typegpu-docs/src/examples/threejs/attractors/meta.json | Adds metadata configuration defining the example's title, category, and experimental tag |
| apps/typegpu-docs/src/examples/threejs/attractors/index.html | Provides minimal HTML structure with a canvas element configured to fit its container |
| apps/typegpu-docs/src/examples/threejs/attractors/index.ts | Implements the complete particle simulation with GPU compute shaders, Three.js rendering, attractor physics, and interactive controls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This reverts commit a4fde76.
) * feat: tgpu.comptime, tgpu.rawCodeSnippet and `this` allowed in TypeGPU shader functions * Fix tests * Better docs for rawCodeSnippet * Docs for comptime * - Namable comptime - Turned `extensionEnabled` into a comptime function * Fixes * Add @typegpu/three package and Three.js integration example (very WIP) * Update tgpuThree.ts * Three.js types for example code view * More tweaks and experiments * More work * A bit more work * More work * Using @typegpu/noise in Three.js * Add a new example * Testing compute in Three.js * Update examples * Update typegpu-material.ts * Update index.ts * Some more work * Works again * TypeGPU compute shaders in TSL! * A bit of a refactor of the cloth example * Cleanup 🧹 * Comparing Three and TypeGPU output * triNoise3D in TypeGPU * comptime * Support for 'this' in TypeGPU shader functions * Update verlet.ts * feat: Attractors example (#1949) * Tweaks * feat: Tweaks to feat/tgpu-three (#1954) * Some review fixes * Thumbnails and tags * Comptime fromTSL * Update shellless.test.ts * fix: Calling `toTSL` multiple times (#1974) * feat: Inform user about type mismatches (#1988) * Fix renderer resizing when browser zoom * docs: Cloth example controls (#1986) * feat: ThreeJS 'Compute Particles' with tgpu (#1947) * feat: ThreeJS 'Compute Geometry' with tgpu (#1948) * feat: ThreeJS 'Compute Snow Particles' example in tgpu (#1972) * fix: @typegpu/three toTSL should have a per-stage namespace (#1994) --------- Co-authored-by: Iwo Plaza <iwoplaza@gmail.com> Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com> Co-authored-by: Rafal Lukosz <93160829+lursz@users.noreply.github.com> Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
No description provided.