Live data from Hacker News

How I learned Vulkan and wrote a small game engine with it (2024)

edw.is

31–40 of 107 posts

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#31
post #9

Earlier quoted context omitted.

If you don't need 4K PBR rendering, a software renderer is a lot of fun to write.

Interesting. I wouldn't actually mind learning how to do that; any tips on how/where to get started?

Tsoding has been live streaming the development of a software renderer as of late: https://www.youtube.com/watch?v=maSIQg8IFRI

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#32
post #7
post #4

My opinions of Vulkan have not changed significantly since this was posted a year ago https://news.ycombinator.com/item?id=40601605 I'm sure Vulkan is fun and wonderful for people who really want low level control of the graphic stack, but I found it completely miserable to use. I still haven't really found a graphics API that works at the level I want that I enjoyed using; I would like to get more into graphics prog…

`wgpu` in Rust is an excellent middle ground, matching the abstraction level of WebGPU. More capable than OpenGL, but you don’t have to deal with things like resource barriers and layout transitions. The reason you don’t is that it does an amount of bookkeeping for you at runtime, only supports using a single, general queue per device, and several other limitations that only matter when you want to max out the capabi…

How easy is it to integrate wgpu if the rest of your game is developed with a language that isn't rust? (e.g. C# or C++)

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#33
post #12

Vulkan was one of the hardest thing I've ever tried to learn. It's so unintuitive and tedious that seemingly drains the joy out of programming. Tiny brain =(

You don't have a tiny brain. Vulkan is a low-level chip abstraction API, and is about as joyful to use as a low-level USB API. For a more fun experience with very small amounts of source code needed to get started, I'd recommend trying OpenGL (especially pre-2.0 when they introduced shaders and started down the GPU-programming path), but the industry is dead-set on killing OpenGL for some reason.

Does anyone know why the industry is killing OpenGL?

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#34
post #11
post #4

My opinions of Vulkan have not changed significantly since this was posted a year ago https://news.ycombinator.com/item?id=40601605 I'm sure Vulkan is fun and wonderful for people who really want low level control of the graphic stack, but I found it completely miserable to use. I still haven't really found a graphics API that works at the level I want that I enjoyed using; I would like to get more into graphics prog…

To this day, the best 3D API I’ve used (and I’ve tried quite a few over the years) is Apple’s SceneKit. Just the right levels of abstraction needed to get things on the screen in a productive, performant manner for most common use cases, from data visualization to games, with no cruft. Sadly 1) Apple only, 2) soft deprecated.

Trying to write a ground up game engine in Metal is a very serious exercise in self-discipline. Literally everything you need is right at your finger tips with RealityKit / old SceneKit. It’s so tempting to cheat or take a few short cuts. There’s even a fully featured physics engine in there.

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#35
post #7

Earlier quoted context omitted.

`wgpu` in Rust is an excellent middle ground, matching the abstraction level of WebGPU. More capable than OpenGL, but you don’t have to deal with things like resource barriers and layout transitions. The reason you don’t is that it does an amount of bookkeeping for you at runtime, only supports using a single, general queue per device, and several other limitations that only matter when you want to max out the capabi…

How easy is it to integrate wgpu if the rest of your game is developed with a language that isn't rust? (e.g. C# or C++)

Very! there are unified headers and a C library that the maintainers have written as a wrapper around the library.

https://github.com/gfx-rs/wgpu-native

https://github.com/eliemichel/WebGPU-Cpp

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#36
post #9

Earlier quoted context omitted.

If you don't need 4K PBR rendering, a software renderer is a lot of fun to write.

Interesting. I wouldn't actually mind learning how to do that; any tips on how/where to get started?

Pikuma.com has a good one.

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#37
post #4

My opinions of Vulkan have not changed significantly since this was posted a year ago https://news.ycombinator.com/item?id=40601605 I'm sure Vulkan is fun and wonderful for people who really want low level control of the graphic stack, but I found it completely miserable to use. I still haven't really found a graphics API that works at the level I want that I enjoyed using; I would like to get more into graphics prog…

SDL 3.0 introduced their GPU API a year or so ago, which is an abstraction layer on top of vulkan/others, might want to check it out. Although after writing an entire engine with it, I ended up wanting more control, more perf, and to not be limited by the lowest common denominator limits of the various backends, and just ended up switching back to a Vulkan-based engine. However, I took a lot of learnings from the SDL…

But sdl is super high level. If you want to do more than pong, you'll hit a wall very quickly.

I just want OpenGL, it was the perfect level of abstraction. I still use it today, both at work and for personal projects.

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#38

Earlier quoted context omitted.

SDL 3.0 introduced their GPU API a year or so ago, which is an abstraction layer on top of vulkan/others, might want to check it out. Although after writing an entire engine with it, I ended up wanting more control, more perf, and to not be limited by the lowest common denominator limits of the various backends, and just ended up switching back to a Vulkan-based engine. However, I took a lot of learnings from the SDL…

But sdl is super high level. If you want to do more than pong, you'll hit a wall very quickly. I just want OpenGL, it was the perfect level of abstraction. I still use it today, both at work and for personal projects.

I like OpenGL ES but the support for compute shaders sucks. I hate transform feedbacks. I am in the process of trying out WebGPU now, but it doesn't have good native support everywhere like OpenGL ES 3 does.

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#39
post #33

Earlier quoted context omitted.

You don't have a tiny brain. Vulkan is a low-level chip abstraction API, and is about as joyful to use as a low-level USB API. For a more fun experience with very small amounts of source code needed to get started, I'd recommend trying OpenGL (especially pre-2.0 when they introduced shaders and started down the GPU-programming path), but the industry is dead-set on killing OpenGL for some reason.

Does anyone know why the industry is killing OpenGL?

People wanted more direct control over the GPU and memory, instead of having the drivers do that hard work.

To fix this AMD developed Mantle in 2013. This inspired others: Apple released Metal in 2014, Microsoft released DX12 in 2015, and Khronos released Vulkan in 2016 based on Mantle. They're all kind of similar (some APIs better than others IMO).

OpenGL did get some extensions to improve it too but in the end all the big engines just use the other 3.

Re: How I learned Vulkan and wrote a small game engine with it (2024)

#40
post #9

Earlier quoted context omitted.

If you don't need 4K PBR rendering, a software renderer is a lot of fun to write.

Interesting. I wouldn't actually mind learning how to do that; any tips on how/where to get started?

Pikuma.com writes a software renderer pretty much from scratch with all the necessary math and explanations in a very pedagogical way. Highly recommend it
Post reply on HN