Skip to content

Ported the stroke shader to WebGPU renderer #7915

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

Merged
merged 20 commits into from
Jun 16, 2025

Conversation

lukeplowden
Copy link
Member

Changes:
I've ported the WebGL/ GLSL stroke shader to the experimental WebGPU renderer. It also includes the hooks.

Screenshots of the change:
image

@lukeplowden lukeplowden requested a review from davepagurek June 16, 2025 15:30
@@ -665,7 +675,7 @@ class RendererWebGPU extends Renderer3D {
new RegExp(`struct\\s+${structName}\\s*\\{([^\\}]+)\\}`)
);
if (!structMatch) {
throw new Error(`Can't find a struct definition for ${structName}`);
throw new Error(`Can't find a struct defnition for ${structName}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a character got lost in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm true sorry, growing pains from switching text editor

discard;
}
}
var col = HOOK_getFinalColor(vec4<f32>(inputs.color.rgb, 1.) * inputs.color.a);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I noticed this and updated it in the color shader too, but I had intended the hooks to always get un-multiplied alpha, so the multiplication by the alpha channel would happen after the hook instead of before. The GLSL version of this may need that update too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will update!

console.log(
"🌸 p5.js says: Instancing is only supported in WebGL2 mode"
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be missing a } here

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for working on this!

@davepagurek davepagurek merged commit a454ffe into processing:webgpu Jun 16, 2025
1 of 2 checks passed
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.

2 participants