Live data from Hacker News

I learned Vulkan and wrote a small game engine with it

edw.is

21–30 of 268 posts

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

#21
post #16
post #5

Earlier quoted context omitted.

It's not quite as bad as it used to be, various later additions to Vulkan like dynamic rendering have eliminated some of the complexity it originally had. Figuring out which subset you should be using is a challenge in itself though, especially since there's a lot of outdated introductory resources floating around which still promote the ultra-verbose Vulkan 1.0 way of doing things. If a tutorial tells you to use ren…

Unfortunately, dynamic rendering didn't come about until "recently". Many devices are stuck on Vulkan 1.1. Go to http://vulkan.gpuinfo.org/listextensions.php and search for dynamic_rendering. It's only supported on about 28% of reports. If you want to support those other devices you have to have a non-dynamic rendering path, and then at that point dynamic rendering is just more code. VK_EXT_shader_object is even bett…

> only supported on about 28% of reports.

This information is misleading because it includes old reports from years ago, before this feature existed. It does NOT mean that 28% of devices out there have support. You will need Steam hardware survey results and cross reference gpuinfo.org or Android hardware survey results which directly list Vulkan versions.

Dynamic rendering is available on all desktop GPUs (Intel, NV, AMD), on all desktop OSes (Windows, Macos, Linux) as long as you've got drivers that are up to date (no older than 2023).

For mobile devices, the situation isn't as good. Updating mobile GPU drivers is an unsolved problem.

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

#22
post #14

I think vulkan is great, but its only purpose is to take full advantage of advanced GPU features. It also leads to better performance when using advanced GPU features compared to OpenGL. Generally, I feel OpenGL is the recommended route if you don't really aim for advanced rendering techniques. There are plenty 2D /lowpoly/ps1-graphics games right now, and those don't need to use vulkan. Vulkan is an example of how t…

The general idea is that if you care more about gameplay and features, use an existing engine, the engine itself takes advantage of Vulkan, or whatever backend is the most appropriate, so you don't have to.

OpenGL is kind of a middle ground. That's if you want to get technical, but not micromanage every detail and write pages of boilerplate. It is also a great introduction to graphics programming. More than an introduction actually, there is a lot you can do with OpenGL.

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

#23
post #5

Earlier quoted context omitted.

It's not quite as bad as it used to be, various later additions to Vulkan like dynamic rendering have eliminated some of the complexity it originally had. Figuring out which subset you should be using is a challenge in itself though, especially since there's a lot of outdated introductory resources floating around which still promote the ultra-verbose Vulkan 1.0 way of doing things. If a tutorial tells you to use ren…

Interesting, for a while the guidance for a while was to learn webgpu instead unless you needed all that extra control. Do you think these changes modify that guidance?

With WebGPU/wgpu you don't get mesh shaders, ray tracing or shader subgroup/wave/warp operations. Its feature set is comparable to Vulkan 1.0, and Vulkan has progressed a lot since.

And WebGPU still requires all the RenderPass setup code which is a lot of boilerplate that Vulkan no longer requires.

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

#24
post #14

I think vulkan is great, but its only purpose is to take full advantage of advanced GPU features. It also leads to better performance when using advanced GPU features compared to OpenGL. Generally, I feel OpenGL is the recommended route if you don't really aim for advanced rendering techniques. There are plenty 2D /lowpoly/ps1-graphics games right now, and those don't need to use vulkan. Vulkan is an example of how t…

> Vulkan is an example of how the AAA gaming industry is skewed towards rendering quality and appearance. AAA game studios justify their budget with those very advanced engines and content, but there is a growing market of 2D/low poly game, because players are tired and realized they want gameplay, not graphics.

I think the driver here is more likely the financial reality of game development. High-fidelity graphics are incredibly expensive, and small game studios simply cannot produce them on a realistic timeline and budget. Would consumers reject indie games with AAA-quality graphics? I think not. It's just that few such games exist because it's not financially viable, and there is a large enough market that is fine with more stylized, lower-fidelity graphics.

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

#25

Lots of good advice in this article. One that stuck out to me: Don’t implement something unless you need it right now This is a constant battle I fight with more junior programmers, who maybe have a few years of experience, but who are still getting there. They are often obsessed with "best-practices" and whatever fancy new tool is trending, but they have trouble starting with the problem they need to solve and focus…

Definitely agree.

But there’s a fine line between implementing things but the difficulty being understanding long term vision and making sure short term improvements don’t actively work against the ‘ideal’. Kind of hard for newer programmers to get a good sense of system design.

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

#26
post #14

I think vulkan is great, but its only purpose is to take full advantage of advanced GPU features. It also leads to better performance when using advanced GPU features compared to OpenGL. Generally, I feel OpenGL is the recommended route if you don't really aim for advanced rendering techniques. There are plenty 2D /lowpoly/ps1-graphics games right now, and those don't need to use vulkan. Vulkan is an example of how t…

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…

It's a JavaScript API, it only runs in the browser. It's not real.

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

#28
post #13

Earlier quoted context omitted.

WebGPU (or Metal if you're in Apple land) still has a much gentler learning curve. The simplifications to Vulkan weren't really aimed at making it easier to use, just streamlining parts of the API which turned out to be needlessly complex, so the parts that are complex for a reason are still just as complex.

Thanks! Other than a project not running as fast as necessary, do you have any advice on how to know when/if I need to switch to vulkan?

Aside from performance there's also just more hardware features exposed via Vulkan, as a sibling mentioned if you want to do anything with raytracing for example then you will have to graduate to Vulkan in order to take advantage of hardware acceleration.

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

#29
post #21
post #16

Earlier quoted context omitted.

Unfortunately, dynamic rendering didn't come about until "recently". Many devices are stuck on Vulkan 1.1. Go to http://vulkan.gpuinfo.org/listextensions.php and search for dynamic_rendering. It's only supported on about 28% of reports. If you want to support those other devices you have to have a non-dynamic rendering path, and then at that point dynamic rendering is just more code. VK_EXT_shader_object is even bett…

> only supported on about 28% of reports. This information is misleading because it includes old reports from years ago, before this feature existed. It does NOT mean that 28% of devices out there have support. You will need Steam hardware survey results and cross reference gpuinfo.org or Android hardware survey results which directly list Vulkan versions. Dynamic rendering is available on all desktop GPUs (Intel, NV…

I get your point. But you might be surprised how many PCs are still in use that have pre-Skylake Intel IGPs. Some people just don't update their drivers, either.

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

#30
post #14

I think vulkan is great, but its only purpose is to take full advantage of advanced GPU features. It also leads to better performance when using advanced GPU features compared to OpenGL. Generally, I feel OpenGL is the recommended route if you don't really aim for advanced rendering techniques. There are plenty 2D /lowpoly/ps1-graphics games right now, and those don't need to use vulkan. Vulkan is an example of how t…

Vulkan has advantages over OpenGL even if you don't care about visual fidelity.

- No global state

- You can select which GPU you want to use at runtime

- OpenGL error handling is terrible

- Validation layers!!

- Cool official artwork

- Fantastic documentation

- You can upload data to the GPU asynchronously from a second thread in a sane way

- Fancy GPU features - Mesh shaders, RTX

Post reply on HN