Live data from Hacker News

WebGPU Fundamentals

webgpufundamentals.org

131–140 of 211 posts

Re: WebGPU Fundamentals

#131
post #116

Earlier quoted context omitted.

This is usually done with shaders and a circle of buffers which maintain state.

Total graphics / shaders / GPU noob here. Does that mean you'll essentially get free visualisations (albeit non-sensical ones) as a byproduct of your computations?

No, it's an @compute shader rather than a combination of @vertex and @fragment shaders (which would do graphics) in the case of WebGPU.

Surely you could visualize it but not as a side effect.

Re: WebGPU Fundamentals

#132
post #95
post #44

Earlier quoted context omitted.

Free yourself from the notion that a web browser purely browses The Web. It's nowadays also a cross-platform insta-deployment GUI application runtime environment with mostly bad native OS integration and performance characteristics (both ~improving, there's even native filesystem access now). In any case it's Good Enough (C), so it sticks.

> Free yourself from the notion that a web browser purely browses The Web. Free yourself from the notion that a web browser should do anything more than browsing the web. native applications have existed for decades, no reason to bloat the scope of a browser.

One big reason is that installing the software is one click (on the link) and it works every time. With native software, on phones you have to open the App Store, search for an app and usually wait to download hundreds of megabytes before anything happens. On personal computers it's much worse.

Re: WebGPU Fundamentals

#133

Regarding all the arguments about ever-increasing browser complexity and the resulting inefficiency: Why is nobody asking the reverse question: How to make operating systems more like browsers?? From the end user's PoV (consider someone who isn't computer savvy) what are the actual objective differences in usability, between the OS and browser? -- • OS: Apps have their own windows and menu bars. • Browser: Multiple a…

They already did, it is called app stores.

Re: WebGPU Fundamentals

#134
It's a pity that tfjs never truly developed any decent ops. E.g. you need lgamma to implement the cap for zero-inflated poisson regression and tfjs simply doesn't have that: https://github.com/tensorflow/tfjs/issues/2011 Those guys simply dropped the ball on the floor, and the further framework development fizzled out. I tried to find if WebGPU could be a replacement, but it's very hard to find a good description of the API surface. MDN also doesn't seem to help much – https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API I really hope that one day I'll find something similar to pytorch, only in typescript. Tell me I'll live long enough to enjoy that day.

Re: WebGPU Fundamentals

#135
post #19

Question for discussion: when have we reached the point where the Browser Feature-creep is too much and we say "okay, a browser probably doesn't need this"? Because after seeing WebUSB and WebGPU I think my personal limit has been reached.

Why exactly would programs running in web browsers not want the ability to access the most powerful piece of hardware in a users machine? WGPU unlocks an enormous amount of space for userland programs to explore.

I agree there have been some questionable 'advancements' in the web spec recently (web workers as a solution to multithreading, for example, were hilariously inadequate for quite a while), but as far as I can tell WGPU is a solid effort to unlock browsers as an actually interactive platform, instead of the fairly static image/text display devices they are today.

Maybe our visions of what browsers could or 'should' be are different

Re: WebGPU Fundamentals

#136

How do I render text with GPU? Do I render text on texture with CPU and then send that texture to GPU? Do I vectorize it and draw millions of tiny triangles to approximate those vectors? It's interesting for me to explore WebGPU as a canvas for app development, but it's not obvious to me how to draw text and text is everywhere.

Most web games use the dom as a layer over top of the 3D canvas and then use 3D to 2D projections to align the elements. This allows you to use regular HTML and CSS for a lot of text elements. Also, you can render and rasterize fonts + dynamic text to a texture and UV map it to a quad in 3D space if you need to. This is pretty inexpensive and easy to do as well. Lastly, the most difficult but performant option is usi…

From personal experience, if you're trying to make a game that cares about its frame rate, do not ever use the DOM for anything, ever. It routinely takes several frames to layout a single absolutely positioned element.

I recommend the second option. Rasterize your font with stb_truetype to a bitmap, and draw quads yourself

Re: WebGPU Fundamentals

#137

Earlier quoted context omitted.

The OS runs on hardware, what do you think is below the OS you're running? Even excluding VMs, there are a lot of OSes running in a modern computer. Some chips have their own. BIOSes and Secure Enclave, networking chips, and probably a dozen more.

Try to understand the context of more than one comment at a time if you can. This person said "it's turtles all the way down" because there are two layers, the browser and the OS, which is ridiculous.

Try to understand the context of more than one comment at a time if you can.

Try not to be a condescending dickweed, if you can.

Re: WebGPU Fundamentals

#138

Earlier quoted context omitted.

Browsers are just “standardised” OS at this point. Really, what is the difference? It seems to me that people basically wants a 1 to 1 mapping between every OS feature to browsers. I wouldn’t be surprised if this standard will fall apart in the next decade once Chrome runs everything. That is to say Chrome is the standard. I am already seeing websites drop support for Firefox and won’t even load using it.

> I am already seeing websites drop support for Firefox Examples?

Snapchat web

Re: WebGPU Fundamentals

#139
post #95
post #44

Earlier quoted context omitted.

Free yourself from the notion that a web browser purely browses The Web. It's nowadays also a cross-platform insta-deployment GUI application runtime environment with mostly bad native OS integration and performance characteristics (both ~improving, there's even native filesystem access now). In any case it's Good Enough (C), so it sticks.

> Free yourself from the notion that a web browser purely browses The Web. Free yourself from the notion that a web browser should do anything more than browsing the web. native applications have existed for decades, no reason to bloat the scope of a browser.

Hmm, RGamma describes reality: it is a fact that web browsers don't purely browse The Web, has been for decades now, and there is zero indication this is going to change.

You seem to demand that people ignore this reality, because you don't like it. This is not helpful.

I don't like this reality either, but despite that I find your statement also factually incorrect: "native applications have existed for decades, no reason to bloat the scope of a browser".

Of course there are reasons, otherwise people/companies won't do it, and users won't use bloated browser that give them no benefits.

I agree that downsides outweigh the upsides, but the upsides are obvious and immediate while the downsides are long-term and mostly subtle...

Re: WebGPU Fundamentals

#140
post #19

Question for discussion: when have we reached the point where the Browser Feature-creep is too much and we say "okay, a browser probably doesn't need this"? Because after seeing WebUSB and WebGPU I think my personal limit has been reached.

Why exactly would programs running in web browsers not want the ability to access the most powerful piece of hardware in a users machine? WGPU unlocks an enormous amount of space for userland programs to explore. I agree there have been some questionable 'advancements' in the web spec recently (web workers as a solution to multithreading, for example, were hilariously inadequate for quite a while), but as far as I ca…

At least for me a browser should be an interactive document viewer. Not CAD, not file conversion, not writing OS images to an SD card, not generating GCode. Ingesting HTML, CSS, and JS and turning it into an interactive view of that XML document nothing more, nothing less.
Post reply on HN