-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add WIP WebGPU mode #8179
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
Open
davepagurek
wants to merge
109
commits into
dev-2.0
Choose a base branch
from
webgpu
base: dev-2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add WIP WebGPU mode #8179
+11,750
−4,466
Conversation
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
Contributor
Author
|
Update: added a WGSL backend for p5.strands! This silly little demo is running this shader: baseMaterialShader().modify(() => {
const time = uniformFloat(() => millis())
p.getWorldInputs((inputs) => {
inputs.position.y += 40 * sin(time * 0.005);
return inputs;
});
})Screen.Recording.2025-11-22.at.7.29.16.PM.mov |
3 tasks
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
Author
|
Update: filter shaders now work in WebGPU! also the base filter implementations are now in p5.strands so that we get both implementations "for free" |
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 refactors
RendererGLinto two classes,Renderer3D, and a subclassRendererGL. It also introduces a newRendererWebGPUthat extendsRenderer3Das well.No WebGPU code is bound by default. Currently it can be tested just by importing its addon module and setting it up, e.g. this test sketch using textures and framebuffers:
WebGPU test sketch source code
Notes
WEBGPUmode, you need toawait createCanvas(w, h, WEBGPU)await loadPixels()andawait get()imageLight()filter shadersfont renderingp5.strands (currently shader hooks work, but only written in WGSL, not in js)clipping