Skip to content

Refactor falling berries to use WebGPU compute shaders#624

Merged
ford442 merged 2 commits intomainfrom
feature/falling-berries-compute-1120028224226334643
Apr 11, 2026
Merged

Refactor falling berries to use WebGPU compute shaders#624
ford442 merged 2 commits intomainfrom
feature/falling-berries-compute-1120028224226334643

Conversation

@ford442
Copy link
Copy Markdown
Owner

@ford442 ford442 commented Apr 10, 2026

Migrated the falling berry physics and transformation updates in src/foliage/berries.ts from a CPU-side loop managing an instanceMatrix to a native WebGPU ComputeNode. Used StorageInstancedBufferAttribute to track position and velocity. Retained a lightweight CPU proxy solely for resolving player collection collisions, drastically reducing CPU Float32Array write overhead and eliminating the O(N) .setMatrixAt calls.


PR created automatically by Jules for task 1120028224226334643 started by @ford442

Migrated the falling berry physics and transformation updates in `src/foliage/berries.ts` from a CPU-side loop managing an `instanceMatrix` to a native WebGPU `ComputeNode`. Used `StorageInstancedBufferAttribute` to track position and velocity. Retained a lightweight CPU proxy solely for resolving player collection collisions, drastically reducing CPU `Float32Array` write overhead and eliminating the `O(N)` `.setMatrixAt` calls.

Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ford442 ford442 merged commit a3df93b into main Apr 11, 2026
1 check passed
@ford442 ford442 deleted the feature/falling-berries-compute-1120028224226334643 branch April 11, 2026 11:13
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.

1 participant