This is a great idea! ShaderPad should be able to wrap into a web component easily. I already export a React wrapper[1], so I can use a similar API for the web component.
I’ve been doing something very similar recently[0] with slightly different goals (still a tiny bundle size, but fully typed uniforms, deeper control over buffer bytes and layout, and less setup than raw gl).
Some in the comments seem to think GL is dead, but for me I think it’s just an easier shader language for beginners and that’s most important for dabbling and many small web use cases.
really appreciate this. As an occasional dabbler in shaders, I find setting up the boilerplate to get a shader working on web painful to setup every time I have to work on a project that requires. starring this on github for later.
Great point; I wasn’t sure if anyone would see this post so I spent most of my time on the docs. I just added a few visual examples to the post. Thanks!
What part of WebGPU isn't meeting graphics performance? AFAICT it's only people who continue to treat it like WebGL. It's like C++ programmers complaining Rust is slow and then Rust programmers say "stop using it like C++". If you want perf in a low-level API liek WebGPU you have to work with it using patterns that fit. If you stick to your WebGL patterns then yea, your app will suck.
I was speaking more to the willingness of vendors to support. It's debatable how well WebGL(2)/WebGPU are designed and especially implemented. But it does seem like most evolutionary features, if they make it to browsers at all, would come from the WebGPU path. Not saying the reasons for that are good.
<shader-doodle> is one: https://github.com/halvves/shader-doodle but it hasn't been updated in a long time and I think builds to UMD
<shaderview> is a newer one with a nice site, but I haven't used it: https://keithclark.github.io/shaderview/