Live data from Hacker News

I learned Vulkan and wrote a small game engine with it

edw.is

231–240 of 268 posts

Re: I learned Vulkan and wrote a small game engine with it

#231
post #196

Earlier quoted context omitted.

A middle ground is webgpu. It is much less verbose than Vulkan and is guaranteed to run anywhere, including the browser. At the same time, it has access to "modern" features like compute shaders which would not be available in webgl. It also doesn't have much legacy cruft leading to multiple ways of doing the same thing, unlike opengl. The main advantage is that it's new, so there are many fewer tutorials available f…

Compute shaders aren't available in WebGL thanks to Google, OpenGL ES does them just fine.

WebGL isn't WebGPU. WebGPU has compute shaders: https://docs.rs/wgpu/latest/wgpu/struct.ComputePass.html https://www.w3.org/TR/WGSL/#compute-attr

(Edit: ah, I missed the bit in GP that you replied to.)

Re: I learned Vulkan and wrote a small game engine with it

#233
post #196

Earlier quoted context omitted.

Compute shaders aren't available in WebGL thanks to Google, OpenGL ES does them just fine.

WebGL isn't WebGPU. WebGPU has compute shaders: https://docs.rs/wgpu/latest/wgpu/struct.ComputePass.html https://www.w3.org/TR/WGSL/#compute-attr (Edit: ah, I missed the bit in GP that you replied to.)

That doesn't invalidate what I said, rather that we could have gotten WebGL 2.0 Compute much sooner than WebGPU if it wasn't for bloody politics among browser vendors.

https://github.com/9ballsyndrome/WebGL_Compute_shader

https://github.com/9ballsyndrome/WebGL_Compute_shader/issues...

https://issues.chromium.org/issues/40150444

"Intel spearheaded the webgl2-compute context to provide a way to run GPU compute workloads on the web. At the same time, the WebGPU effort at the W3C aimed to design a new, lower-level graphics API, including GPU compute. The webgl2-compute approach encountered some technical barriers, including that macOS' OpenGL implementation never supported compute shaders, meaning that it wasn't easily portable. webgl2-compute has so far been used by customers for prototyping.

At present, WebGPU is close to shipment, and its shader pipeline is nearing completion. It's possible to run combined GPU rendering and compute workloads in WebGPU.

In order to reclaim code space in Chromium's installer that is needed by WebGPU, the webgl2-compute context must be removed."

Because webgl2-compute took soooo much space on the installer!

And it isn't as if Google isn't doing WebGPU compute on top of DirectX on Windows, but doing it on top of Metal on Apple, unthinkable!

By the way, where are the Safari and Firefox implementations of WebGPU compute, running on stable without browser flags?

Re: I learned Vulkan and wrote a small game engine with it

#234
post #178

I tried learning Vulkan a little more than a year ago and I have no desire to ever touch it again. It really bothers me that we're deprecating OpenGL and replacing it with something that's ridiculously hard to do anything simple (e.g. doing a spinning cube takes several hundred lines of code). OpenGL was never "easy" but it was at least something a regular person could learn the basics of in a fairly short amount of…

If you want OpenGL use ANGLE https://github.com/google/angle several phones now ship ANGLE as their only OpenGL support on top of their Vulkan drivers. If you want a modern-ish API that's relatively easy and portable use WebGPU via wgpu (rust) or dawn (c++).

ANGLE is such a pain to build, I've never managed to do it.

Re: I learned Vulkan and wrote a small game engine with it

#235
post #178

I tried learning Vulkan a little more than a year ago and I have no desire to ever touch it again. It really bothers me that we're deprecating OpenGL and replacing it with something that's ridiculously hard to do anything simple (e.g. doing a spinning cube takes several hundred lines of code). OpenGL was never "easy" but it was at least something a regular person could learn the basics of in a fairly short amount of…

If you want OpenGL use ANGLE https://github.com/google/angle several phones now ship ANGLE as their only OpenGL support on top of their Vulkan drivers. If you want a modern-ish API that's relatively easy and portable use WebGPU via wgpu (rust) or dawn (c++).

Which can be quite the pain, when the phone vendors just drop the support for OpenGL ES 1 from their ANGLE binaries, probably under the assumption that "nobody uses such old APIs".

Re: I learned Vulkan and wrote a small game engine with it

#236

Earlier quoted context omitted.

> WGPU doesn't support multiple threads updating GPU memory without interference WGPU uses WebGPU and AFAIK no browser so far supports "threads". https://gpuweb.github.io/gpuweb/explainer/#multithreading https://github.com/gpuweb/gpuweb/issues/354 And OpenGL never supported "threads", so anything using OpenGL can't either.

WGPU is an implementation of WebGPU. This is more accurate than saying it uses WebGPU; WebGPU is not software, you can't use it. WGPU goes beyond WebGPU in many ways already, and could also support threads.

> WGPU is an implementation of WebGPU

No.

    wgpu is a safe and portable graphics library for Rust based on the WebGPU API. 
    ...
    and browsers via WebAssembly on WebGPU and WebGL2.
https://wgpu.rs/

> WebGPU is not software, you can't use it

It's an API that you can use, like OpenGL, Vulkan, Metal, .... Here you can see the current Browser support: https://caniuse.com/webgpu

Re: I learned Vulkan and wrote a small game engine with it

#237
post #93

This minimalism is very effective. I took the opposite approach, and it has cause great pain. I've been writing a metaverse client in Rust. Right now, it's running on another screen, showing an avatar riding a tram through a large steampunk city. I let that run for 12 hours before shipping a new pre-release. This uses Vulkan, but it has WGPU and Rend3 on top. Rend3 offers a very clean API - you create meshes, 2d text…

I thought your earlier thread on URLO very interesting https://users.rust-lang.org/t/game-dev-in-rust-some-notes-on...

Re: I learned Vulkan and wrote a small game engine with it

#238
post #93

This minimalism is very effective. I took the opposite approach, and it has cause great pain. I've been writing a metaverse client in Rust. Right now, it's running on another screen, showing an avatar riding a tram through a large steampunk city. I let that run for 12 hours before shipping a new pre-release. This uses Vulkan, but it has WGPU and Rend3 on top. Rend3 offers a very clean API - you create meshes, 2d text…

> Both Vulkan and Metal support that. But, of course, Apple does it differently.

Metal is older than Vulkan. So really, Vulkan does it differently.

Re: I learned Vulkan and wrote a small game engine with it

#239
post #136

Earlier quoted context omitted.

Yes, I agree. With current hardware and tools, it becomes much cheaper to reach graphics quality that is 10 or 15 years old, so such game would be just enough and be profitable enough. I think that high quality rendering is reaching a tipping point where it's mostly of diminishing returns, this means AAA studios could differentiate with good graphics, but this becomes less and less true. Gameplay matters, and the inn…

gameplay matters, but graphics sell. Look no further at the modern state of hardcore reviewers and hyper nitpickers on social media. See how every switch game is criticized for not being 1080p60 on 2017 mobile hardware. People demand that kind of quality. That's a loud minority, but it's not like the biggest games aren't selling more and more every year en large. So non-vocal gamers do seem to be drawn to it.

There’s a very big difference between ultra realistic PBR graphics and running games at 60 FPS at 1080p.
Post reply on HN