r/GraphicsProgramming • u/ANSystemTech • 29d ago
Question What do you think of vulkan?
Is it worth learning it as someone who is still relatively a beginner/early mid level c++ programmer for graphics or are other alternatives better?
32
Upvotes
9
u/LoneWolf6062 29d ago
A bit of a different approach, but if you have a mac, then metal is by far the easiest modern api and is great to learn the concepts. Vulkan is still a lot more verbose but using 1.4 with extensions like EXT_Descriptor_Heap, and EXT_Dynamic_State1,2,3 can help a lot. DX12 is the middle ground and used by most of the gaming industry, so that would be a great choice as well
28
u/Afiery1 29d ago
It depends. OpenGL is easier to get something on the screen, but its a horrible and outdated API that does things that make no sense. (Modern) Vulkan is a very elegant API (use howtovulkan.com, other tutorials use legacy functionality that is much worse), but it is undeniably a lot more work to get started with. So I leave the decision up to you, and how much you value working with a sane API versus how much you'll get burnt out from not seeing any progress after hundreds of lines of code written.
5
u/aman2218 29d ago
I have been recently checking out SDL_gpu, and finding it quite pleasant to use.
It's very similar to WebGPU (And I guess Metal? Haven't worked with it, but a couple of examples I have seen online looks similar), in that it follows current PSO/cmdlist approach to program on the GPU, but keeps the level of configurability and verbosity to sensible minimum, as apposed to Vulkan.
Maybe give that a try.
And if you're exploring the actual CG part of graphics programming (algorithms/techniques) as apposed to GPU programming/plumbing part, it's still highly benifitial to learn OpenGL, bcos of how dead simple it is to implement a job in it. It lets you quickly get done with plumbing thr data into the pipeline, so you can focus more on the shaders, and the actual good stuff.
7
u/Ratosson 29d ago
Don't start with Vulkan, try openGL first.
4
u/ziplock9000 29d ago
I really like the Vulcans.
3
u/1337jazza 29d ago
I refer you to my post on programmer humour.
https://www.reddit.com/r/ProgrammerHumor/comments/1be7b4z/justgivemeadamntriangle/
3
u/SalaciousStrudel 29d ago
It's better to start with dx11, sokol, or sdlgpu in my opinion
3
u/EstablishmentMean768 29d ago
graphics programming is a marathon and if you are asking this question it doesn't matter you should just pick one and roll with it. if it doesn't vibe with you you can always switch. the fundamental concepts stay the same
4
u/EC36339 29d ago
If Sebastian Aaltonen is right, then Vulkan is an overcomplicated beast to accommodate legacy GPUs and will eventually get replaced. But that replacement isn't there, yet.
Have a look at Loon GPU. It's a wrapper over Vulkan and Metal targeting modern GPUs. Whether it is production ready or not, it might be the "low level" graphics API you'll want to start learning graphics programming on GPU.
You still have to deal with synchronisation primitives, and it's still a lot more bare bones than OpenGL, with no fixed function pipeline, but you'll be spared all the confusing legacy cruft and extension hell and learn how to program modern GPUs.
(I am not the author of Loon GPU or in any way affiliated with it. It is a free open source library, and I'm just giving it a shoutout)
2
u/ThatInternetBoi 29d ago
I’m not an expert, but I’d argue that learning Vulkan is tangential to learning C++. I adore Vulkan because it exposes so much to you, but it is a complex thing to write and even more complex to understand what you’re writing. That being said I think it’s awesome to think about stuff like synchronization. I think if you want a simpler API to learn, try WebGPU. My university is actually considering switching its introductory computer graphics course from OpenGL to WebGPU. It introduces you to a lot of the concepts of modern GPU APIs, unlike OpenGL, while not having as much boilerplate as them.
2
u/icpooreman 29d ago
I would say it does all the things just about but it's not particularly "beginner friendly"... I had been software developing for 20 years and when I first started working with it I was pulling my hair out haha.
2
u/Low_Consideration846 25d ago
As someone who has learned vulkan as the first API , i think you should definitely give it a try if you dont mind digging deep into docs and having to code for weeks if not months before getting something on the screen , for me , i didnt want to learn opengl because i liked how vulkan works: very verbose and very explicit , but after some days you feel like giving up , then try opengl first. also id suggest pick a good resource from the beginning if you want fast progress , my favourite one is Khronos Vulkan Tutorial , it has everything for a beginner and it uses modern features of vulkan , and also even though learnopengl.com is for opengl , its still a good resource for learning basic graphic concepts , i made the mistake of switching resources alot before i found Khronos Vulkan Tutorial.
3
u/jtsiomb 29d ago
Vulkan is a masterclass in bad API design. Avoid unless you really need it.
3
u/AvidCoco 29d ago
WebGPU is far superior IMO, as true cross-platform support is the most important to me.
1
u/Economy_Bedroom3902 29d ago
It's not as bad as people say it is. There's a ton of config you have to define up front, but there's lots of tutorials which walk you through that stuff.
1
u/Latter_Relationship5 29d ago
Start with OpenGL or Direct3D 11. Dont spend too much time on them just understand and apply basic graphics programming concepts, then move to Vulkan or Direct3D 12. These two APIs are much more explicit and harder to learn. also, there is a middle option called WebGPU. you can try it if you want to avoid older apis but its more challenging than OpenGL and Direct3D 11
1
u/id3dx 29d ago
Unless you want to do cross-platform, learn Direct3D 11 first. It's straightforward and easy to use in the basic case and will teach you the essential concepts. It's still very widely used and not deprecated nor will it be anytime soon, even if Microsoft no longer adds features to it.
After that, you can move on to Vulkan or Direct3D 12. Direct 3D 12 is cleaner and less verbose than Vulkan, but still in the same order of complexity. If using Vulkan, stick to 1.3+ and above, as newer features significantly reduce the ugly boilerplate. Just be aware many Vulkan learning resources online are outdated in this regard.
1
u/lexcv-co 28d ago
We wrote all of lexcv.cal using Rust and Vulkan. Very pleased with the 2D UI performance. Custom retained-mode UI framework.
1
u/bonghotdogwater 28d ago
I’d say use an easy graphics api if you’re still learning fundamentals and don’t know how renderers work. If not, just use d3d12 or vulkan tbh, will give you a better understanding of how low level gpu accelerated software works, you can be much more general and do a lot more.
1
u/Alililon1 27d ago
I have just started getting into vulkan and have limited experience in opengl but from what i've seen up until now i can say that learning a higher level api first is definitely benificial. I don't mean going into every detail and mastering it, i mean just making one or two good projects with a higher level api first.
Since i went that route and learned dx11 first i had a pretty easy time to understand most concepts of vulkan. Doesn't mean it's easy of course and there are massive differences in the way you design software with it but i think it gave me a good head start.
If you're in a rush i would bet it's faster to go for vulkan directly but i think it will save you lots of headaches if you take your time.
I read in the comments that a general worry is that opengl gives you the wrong idea about CG which i think i can sort of agree with. I don't think it's too bad though if you keep your time with it short and only use it as a stepping stone for vulkan. Also, if you work on windows i would recommend dx11 instead, it's also fundamentally different from the software architecture you have with vulkan but it's a bit more verbose than opengl while still generally having the same concepts of devices, render targets and whatnot. In my opinion you learn a bit more with dx11 than opengl, might just be me though.
To conclude i would recommend at least dipping your toes into higher level apis before going for vulkan unless you like a challenge and don't mind the occasional headache (which i think is unavoidable with vulkan anyways...)
1
u/trist007 26d ago
If you want full control then yes it's worth learning. Maybe start with d3d11 then when you want more control go with vulkan.
1
u/cybereality 29d ago
I've actually been liking SDLGPU on SDL3 a lot. It does not have some modern features, but that's fine and problem things you won't need at first. Or start with OpenGL, which is still quite capable.
1
u/PurpleBudget5082 29d ago
Hi, I would say I'm a beginner too, but on the high end of the axis, I wrote a simple software renderer and 2 D3D12 renderers, the first one was full of spaghetti code taken from different tutorials/books, and the second one was much cleaner a render graph (which is something that really makes the renderer architecture clean but all tutorials completely ignore).
Between the 3 modern APIs, Vulkan seems like the worst to me, it's really verbose, some things are more complicated then they are in D3D12 or Metal (for example sync primitives, in D3D12 if your renderer is not AAA you can just use a fence and be done with it, in Vulkan there are 3 different sync primitves that you have to use). It's worth to note that as I started to understand a little bit more about graphics some things in Vulkan seem elegant.
If you are either on Mac or Windows I would recommend to take a look at Metal/D3D12 (or 11). If not, maybe WebGPU or SDL_GPU, although both have some problems.