Lurker News
I am excited to announce the launch of my e-book on Graphics/WebGPU programming! This project has consumed much of my spare time, during which I developed various tools to facilitate the publishing process, including a code playground and a static site generator that can reference sample codes.

However, I'm feeling burnt out and ready to call it finished, even though it may not feel completely done. Avoiding another abandoned side project has been my primary motivation in reaching this point.

Comments (73) 18 threads

mistercow2 replies#
This is great to see. I’ve been working on a WebGPU project for a couple months now, learning as I go, and it’s rough how many things there are that take tons of digging to find even remotely straight answers about. There’s the basic WGSL language and JS API, which are, strictly speaking, well documented, and then there’s the stuff where you have to skip past documentation and find the one post answering a tangentially related question by someone with a singleminded interest in GPU programming.
pjmlp1 reply#
This has been the state of the Web3D since WebGL 1.0, worse that after 10 years, browser vendors still don't see a need to have proper debugging in place.
mistercow#
Yes, and not to mention automated testing. Apparently, deno has headless WebGPU support, which I might look into. Right now, I have this hacky build mode in my project which launches my Electron app, and sends IPC messages to launch tests (using my own, terrible minimal test framework), and then send the results back to the terminal.

On the plus side, it makes me appreciate how wonderful it is to have modern dev tooling when I’m working on literally anything else.

jamesu1 reply#
My biggest problem with WebGPU is the documentation, especially if you delve into the native or emscripten variants. Not even fancy AI tools will save you - in fact in a lot of cases they make it worse as they often suggest solutions based on older webgpu variants or they make grossly inaccurate assumptions about how your particular webgpu implementation works. Figuring out how to properly setup the "native" version was a nightmare, I had to find a random github project where someone thankfully made a SDL2 example. I didn't really feel there was an active community that was interested in pointing me in the right direction either, more like a bunch of people too absorbed with building an API than actually caring about who is using it. Maybe things will improve in the future but I remain skeptical.
pjmlp3 replies#
That is to be expected, it is rigth there in the name, Web.

The problem is that people are reaching out to it, as means to avoid the Vulkan mess, when the real alternative is middleware engines.

grovesNL#
There's plenty of room for both approaches: a lot of projects can benefit from using a platform-agnostic API like WebGPU (web or native) directly, others might want to use engines. Anecdotally I use WebGPU (through wgpu) in a commercial application for a visualization, and would've never bothered to apply Vulkan or DX12 for that otherwise.

Documentation will keep improving with time. There have already been a number of high-quality tutorials and references created over the past few years, for example:
https://webgpufundamentals.org/ for JavaScript/the web API
https://sotrh.github.io/learn-wgpu/ for Rust (web or native)
https://eliemichel.github.io/LearnWebGPU/ for C++

galangalalgol1 reply#
I thought vulkan was getting better? I'm mostly interested from a platform agnostic compute perspective, and I've used some libraries that employed wgsl for that. I'd added it to the backlog of stuff to learn but lately it seemed like vulkan might be a better approach.

Continue this thread — 1 reply

johnnyanmac1 reply#
>when the real alternative is middleware engines.

Is there even a good Middleware engine that can also target web? My impressions are that both Unity and Unreal expressed interest in WebGPU support, but what's publicly available is pretty barebones.
Also, I imagine the people working with WebGPU to begin with are either hobbyists, looking to learn and work in a professional role with WebGPU, or are in fact making that future Middleware (be it proprietary or open source).

Continue this thread — 1 reply

jay-barronville#
Congratulations and well done!!!

> However, I'm feeling burnt out and ready to call it finished, even though it may not feel completely done. Avoiding another abandoned side project has been my primary motivation in reaching this point.
Thank you for spending your time to produce this excellent resource and releasing it to us. Don’t feel too bad about it not being all the way where you’d like it to be. You can always improve it later, or even allow the community to help you improve it.

erichdongubler#
I haven't had time to dig into all of these demos, but the material looks _delightful_.

In case it's interesting to anyone, I did just go on a big bug-filing spree for Firefox. There are a handful of issues (that were already on the Firefox team's radar) to resolve before all of these playgrounds work as-is: https://bugzilla.mozilla.org/show_bug.cgi?id=webgpu-unleashe...

dylanhu1 reply#
This is super impressive and really exciting as I am looking to get deeper into WebGPU. Two quick notes on the playground before I dive into the content soon:

1. The playground code does not seem to fully work on Safari. The code is there and selectable but the glyphs are invisible.
EDIT: My Safari was just bugged, had to restart it and it works
2. Is the cover of the book on the right of the playground supposed to change depending on which example you are looking at? I think it could be nice if the book contents were rendered alongside the code if the user wanted instead of the cover which does not change.

nox1011 reply#
Safari has not shipped WebGPU. Why would you expect it to work. Until Safari officially ship WebGPU it's guaranteed to be buggy and missing features.
dylanhu#
I was referring to the code editor in the playground which I assume is not powered by WebGPU. I noticed the issue on other sites as well which prompted me to restart, fixing the issue.

I have WebGPU enabled in Safari through a preview flag, and running the playground examples worked fine.

Load more comments