-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
src/webgpu/p5.RendererWebGPU.js
Outdated
@@ -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}`); |
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.
Looks like a character got lost in here?
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.
Hmm true sorry, growing pains from switching text editor
src/webgpu/shaders/line.js
Outdated
discard; | ||
} | ||
} | ||
var col = HOOK_getFinalColor(vec4<f32>(inputs.color.rgb, 1.) * inputs.color.a); |
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.
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
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.
Ok will update!
console.log( | ||
"🌸 p5.js says: Instancing is only supported in WebGL2 mode" | ||
); | ||
} |
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.
Might be missing a } here
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.
Looks good, thanks for working on this!
Changes:
I've ported the WebGL/ GLSL stroke shader to the experimental WebGPU renderer. It also includes the hooks.
Screenshots of the change:
