Live data from Hacker News

I learned Vulkan and wrote a small game engine with it

edw.is

201–210 of 268 posts

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

#201
post #144

Earlier quoted context omitted.

Khronos keeps pushing this in their promotional materials for the standard, and it's not an advantage. Now instead of vendors writing this correctly once for everyone, everyone can do it poorly. Go read a few Vulkan initialization implementations across a few repositories. It's all the same code, and some people miss portions of it here and there. I don't know how this lie caught on so well, but it doesn't pass the s…

> Now instead of vendors writing this correctly once for everyone, everyone can do it poorly. _Vendors_ did it poorly, which is why everyone wanted to get away from them. You could argue they over-corrected and left _too_ much to the user, but better safe than sorry. Sure users can write bad code as well, but at least it's _consistently_ bad, and fully under their control. There are so many fewer problems nowadays li…

> but on this older intel GPU for a user with outdated drivers it segfaults in the driver

Implying that up to date Intel drivers don't segfault on perfectly valid OpenGL use.

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

#202
post #55

Earlier quoted context omitted.

There is the Zink project[1]. It is an OGL to Vulkan translation layer. [1] https://docs.mesa3d.org/drivers/zink.html

But it's part of Mesa, it's not something you can drop into an app written against OpenGL to translate the calls to Vulkan right?

You absolutely can. It can even build and run on Windows too. I’ve used it to play some modded Minecraft builds where Zink outperformed the native OpenGL2 drivers on my machine. Mainly because the native OpenGL2 driver was terrible at the time for my hardware but it’s 100% a thing you can do.

Some games are even shipping on it [1]

[1] https://www.gamingonlinux.com/2023/02/x-plane-12-now-uses-th...

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

#203
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++).

It's not so much a modern API but a modern feature set. Most ANGLE backends give you an ES 3.0 context (except for 3.2 on Vulkan, so the problem is mostly Apple), and all of them lack some useful extensions to narrow the gap between ES and the desktop APIs.

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

#204

Earlier quoted context omitted.

the biggest part for me is the shader compiler. opengl has one built in, vulkan requires me to pull in yet another dependency i've heard that vulkan allows bindless textures now, so the descriptor nonsense is a bit less awful that it used to be vulkan is appealing, but there's a high initial cost that i don't want to pay

Vulkan is super appealing if you're in the industry and have the time and resources necessary to profit from its advantages. But if you're a single dev who wants to learn game engine design, you're going to have a bad time. Most people also don't get that game engine design is very far removed from actual game design. You can have a ton of fun learning math, physics and computer science when building an engine, but b…

>if you're in the industry and have the time and resources necessary to profit from its advantages.

I don't even know how you get into the graphics industry these days. The bar is so high and I just don't see how you get the knowledge needed for it. I graduated years ago and don't feel any closer now than back in the mid 2010's despite having a lot more experience to point to in other parts of games.

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

#205
post #138
post #23

Earlier quoted context omitted.

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.

Subgroups have actually been added very recently. The rest, sadly missing (along with multi-queue and bindless) :(

Thanks for the update.

Subgroups may seem like a minor feature, but they can unlock huge performance. I recently had a 10x perf boost with a very basic subgroup trick to let neighboring pixels collaborate on some expensive operations in fragment shaders. And there's another 5x in there waiting for me to implement some subgroup quad tricks.

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

#207

Earlier quoted context omitted.

The site definitely has CSS, just not a lot of it.

Indeed. I used as little CSS as I could because I love minimalist websites. And the lack of syntax highlighting was inspired by Go blog, for example. :) Raw HTML definitely looks much uglier, sadly (“Reader mode” in most browsers makes websites without CSS easily readable, though!).

reminds me a lot of http://bettermotherfuckingwebsite.com/

pretty much all HTML, with only the bare minimum CSS to make it somewhat responsive.

I guess if you want one tiny piece of feedback, based on the above site:

>A little less contrast

>Black on white? How often do you see that kind of contrast in real life? Tone it down a bit, asshole. I would've even made this site's background a nice #EEEEEE if I wasn't so focused on keeping declarations to a lean 7 fucking lines.

I agree with the advice, but I've definitely seen many a heated debate over raw black on raw white amongst designers. So take with a grain of salt and a handful of personal preference.

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

#208

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…

> e.g. doing a spinning cube takes several hundred lines of code This really doesn't mean much. The second cube (or another shape) isn't going to double the line count. > OpenGL was never "easy" but it was at least something a regular person could learn the basics of in a fairly short amount of time. The problem is that OpenGL no longer matches current hardware so the naive way to use it is very much suboptimal for p…

>This really doesn't mean much. The second cube (or another shape) isn't going to double the line count.

It's like the difference between "Hello World" in Python and "Hello World" in Java. Doesn't matter in the context of a serious software engineering project, but it's a significant barrier for beginners.

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

#209

Earlier quoted context omitted.

It really bothers me that we're deprecating OpenGL and replacing it with something that's ridiculously hard to do anything simple OpenGL is only deprecated on MacOS, AFAIK, it will exist for many years to come. I'm sure Vulkan is better in some regards but is simply not feasible to expect someone to learn it quickly. Vulkan is often said to be more of a “GPU API” than a high level graphics API. With that in mind, the…

> OpenGL is only deprecated on MacOS, AFAIK, it will exist for many years to come. It's abandondend by Khronos and GPU vendors, which is pretty much the same thing as deprecated unfortunately.

By the way, here's an interesting post by Mike Blumenkrantz (Valve): https://www.supergoodcode.com/manifesto/

Most of it is satire, but it's interesting that the position of "Chair of OpenGL" still exists to this day and a new person was assigned to it in 2024.

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

#210
post #163

Highly recommend this guy’s channel, he livestreams building a Vulkan game engine and he has a crazy style too https://youtube.com/@tokyospliff?si=CMF53295xeETykbP

Oh yeah, I enjoy his streams a lot :D

I can also recommend Arseny Kapoulkine YouTube channel[1]. It can get a bit too advanced at times, but his channel was one of my motivators of getting into Vulkan programming.

[1]: https://www.youtube.com/@zeuxcg

Post reply on HN