8 ms·
An In-Depth Look at WebGPU
- fwlr 4y agoAnother player in the WebGPU field you may want to add is https://usegpu.live/ https://usegpu.live/
- funerr 4y agoAdded! thank you!
- Jasper_ 4y agoThis does not seem particularly in-depth.
- bilekas 4y agoExactly. Seem OP found a fun new tool and decided to go all in. The euphemisms also are questionable. > Everything seems to be moving to the web; I can see how many desktop-related headaches (like installing software) will become irrelevant over time I've heard this since dial up days. We GPU may be a natural progression sure. But it's not the game changer. (Bad pun)
- flohofwoe 4y agoThe most "game changing" feature of WebGPU might be that it finally brings compute shaders to the web. The other improvements are more or less incremental, but (compared to WebGL2) still badly needed and long overdue.
- funerr 4y agoI'm the author, not the poster. Unzip is more of an intro summary of a concept so the title is indeed a bit misleading ;)
- SeanAnderson 4y agoI'm curious if there are technical benefits to interfacing with WebGPU via JS or via WASM (Rust, specifically)? I am currently teaching myself Rust + Bevy with the intent of shipping some proof-of-concept game following the ECS paradigm rendered using WebGPU. This is going fine and I am excited to learn the tech, but my bread-and-butter is JavaScript and I only desire targeting the web. At time of writing, Bevy's (WebGL) examples don't run on Android devices which is a bit concerning. There is some compelling JS tooling out there for rendering - Babylon, AFrame, UseGPU, etc, but they all have their issues. Babylon: not designed with ECS in mind, same as ThreeJS, declarative programming can be achieved through plugins, but it's fragile and significantly less performant than if built natively into the framework. AFrame: powered by Three, but ECS-first and I assume it does a good job at it. Not practical for 2D rendering and really intends to be VR-first with a nod to non-VR 3d. UseGPU: truly what I would like to be using as it's declarative by design, but it's so new that 2D Sprite is still on the TODO list. I'm not skillful enough in low-level graphics programming (yet!) to assist in the development. I really want to be ready for this technological shift. I fully intend to build something as complex as RimWorld that runs in your browser. I'm taking baby steps, as quickly as I can, to get there, but am not sure what tools to be adopting to best prepare. At the moment I'm betting on Bevy because it has a lot of wind behind its sails, its all-in on ECS, and I suspect avoiding GC for compute-heavy gaming will be beneficial. I don't know what interfacing to WebGPU via JS gets me aside from a potentially more rapid prototyping environment. I'd love to hear others' takes on this to ensure I don't burn months looking in the wrong direction.
- rootw0rm 4y agoIf you're okay with voxels, check out veloren.net ECS based game engine in Rust, wgpu rendering, and I've been really impressed with the code quality. I've been trying to find something to inspire me to really go all in with Rust, and I think I found it with Veloren
- SeanAnderson 4y agoThanks for the suggestion! I will check it out. Voxels are definitely interesting :) At first glance, this does look like it will be a great resource. Even just having high-quality examples of how to configure Cargo and etc. boilerplate will save me a lot of hours. Doesn't look like they target WASM at all, though. I wonder what the main concerns were/are?
- sxp 4y agoA better place to start than this article for devs who know WebGL/OpenGLES would be https://toji.github.io/webgpu-gltf-case-study/ https://toji.github.io/webgpu-gltf-case-study/ by one of the Google Chrome devs. I also really liked https://surma.dev/things/webgpu/ https://surma.dev/things/webgpu/ which was my first in depth intro into rendering via WebGPU. I would also suggest https://web.dev/gpu-compute/ https://web.dev/gpu-compute/ which is a good intro to WebGPU compute, but it was out of date and had broken APIs the last time I tried it. But it has useful theory if you've never used GPU compute before.
- funerr 4y agoThanks for the recommendations, adding to the extra section!
- fulafel 4y agoIt's quite late into the text that this mentions WebGPU isn't shipping yet and doesn't mention at all that the spec isn't ready. And in fact WebGL just recently got caught up in Safari to WebGL 2 many years after the spec, has new extensions getting specced and implemented all the time etc. Shiny chasing danger here vs actually shipping something.
- rootw0rm 4y agoThat's fair, but if you're looking at say, coding up many many lines of Vulkan boilerplate for a new project, it does kinda make sense to look into WebGPU
- pjmlp 4y agoLooking into middleware is a much more sane option.
- ivars 4y agoIs anyone here using WebGPU Native in production? In what state is it right now?
- flohofwoe 4y agoFor an "in-depth look" that was surprisingly shallow ;) I was hoping for a bit of discussion about the trade-offs that WebGPU had to accept to create an as-thin-as-possible wrapper around Vulkan, D3D12 and Metal, while at the same time catering to web developers and guaranteeing the safety requirements of the web.
- omnicognate 4y agoDoes anyone know whether wgpu (the rust library) is ready for production, and if not when it might be? The 0.x version number suggests it isn't. I'm aware that WebGPU, and browser support for it, is still in development and subject to change (and that wgpu is the library underlying that), but I'm more interested in using wgpu in native rust programs than in browsers/wasm, and I'm not sure if I need to wait until the spec is finalised and browsers officially support it to do so.
- nicoburns 4y ago> The 0.x version number suggests it isn't In Rust land a 0.x version number only really suggests that the library has an unstable API (expect breaking changes on version bumps). Plenty of very battle tested libraries that are being used in production at huge scale (like the `hyper` HTTP crate for example) still have 0.x versions. I'm not an expert in graphics programming, but my understanding is that wgpu is solid and ready for production if it covers your use case, but there are still things it can't do yet. As long as you're willing to deal with breaking changes, I'd say go for it.
- Traubenfuchs 4y agoWe have had GPU access in the browser for more than a decade now. Are there actually any broadly used applications for it? Everything I come to see appears to be some kind of tech demo that lags behind from what native PC/console games could do 20 years ago...
- flohofwoe 4y agoEver heard of Google Maps and Google Earth?
- Traubenfuchs 4y agoFair enough. Those fullfil any definition of "mass usage". But was that it?
- flohofwoe 4y agoI guess Figma uses WebGL next to WASM but not sure. There are some pretty successful gaming niches like Facebook Instant Games where pretty much all games use WebGL via some sort of middleware, even though most games are simple 2D puzzles. In general, that those web 3D engines (three.js, babylon.js, playcanvas, pixi, etc.. ) even exist for so long must mean that there's some sort of demand for them.
- dmarcos 4y agoFigma. Definitely broadly used. There’s also a whole universe of Web based names (see facebook). In the VR niche I maintain https://moonrider.xyz/ https://moonrider.xyz/ that has had 100k MAUs sustained for 2+ years. Not sure if it qualifies as large scale but definitely non negligible.
- funerr 4y agoHi HN, I'm the author, but not the poster, I didn't plan on posting here yet. Ps Unzip is a summary/intro not an "in indepth article". I try to summarize concepts. But thanks to whoever posted, appreciated either way. AMA
- peter_d_sherman 4y ago>"WebGPU is an abstraction for modern graphics APIs such as Direct3D 12, Metal, and Vulkan" Which means that someone who wanted to write a graphics API and/or graphics API abstraction layer -- would do well to study WebGPU... (in addition to other graphics APIs and graphics API abstraction layers...)