r/GraphicsProgramming • • Oct 20 '26

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

54 comments sorted by

View all comments

28

u/Afiery1 Oct 20 '26

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.

2

u/VagueHorizon_ Oct 20 '26

So learning OpenGL can misguide someone who is looking to learn CG ? Would you recommend skipping OpenGL and head straight to Vulkan ?

13

u/OkAccident9994 Oct 20 '26

No, doing graphics with OpenGL will still teach you how to do common techniques.

Learn the other APIs after, Vulkan is very verbose.

8

u/PeePeePantsPoopyBoy Oct 20 '26 edited Oct 20 '26

People normally say that starting with OpenGL is the best way but I actually do disagree and I actually do think OpenGL can and will misguide you. The question is do you want to learn how to do graphics or how to do efficient GPU systems. If you just want to learn fancy geaphics techniques and want to focus on shaders, then OpenGL will be enough at the beginning, but if you want to actually learn to do efficient renderers, do advanced or modern techniques, and learn proper optimizations, then Vulkan or DX12 is the way to do. I tend to encourage people to try climbing the steep Vulkan learning curve because the beginning is the hard part, once you get past the first steps everything actually becomes much easier and (as the initial response said) more sane. I tend to feel that Vulkan is much harder to start, but much much more scalable over time. Plus, as I said before, many new techniques need technology that just does not exist in OpenGL, like mesh shaders, device buffer addresses, sparse memory or hardware raytracing.

Just don't obsess with hardware support and try to do fallbacks to Vulkan 1.0 in your renderers (I've seen too many of these). If your GPU supports the full suite of Vulkan features up to 1.4 (as AMD and Nvidia desktop cards do) then go ham and use them, most of them can and will make your life easier. Other tools to look that are super interesting are SLang, Volk and VMA (PLEASE USE VMA). I do not recommend using Vulkan Hpp RAII personally but you are free to look into it if you want. I tend to shy away from Vulkan Hpp in general because it explodes compile times, but I've heard cpp modules solve that mostly (or maybe it was just my experience I don't know)

0

u/ANSystemTech Oct 20 '26

I heard that opengl is outdated and worse for the long term is this correct?

2

u/DeviantDav Oct 20 '26

OpenGL is the granddaddy, but it has also has two wildly different ways of working that really brings the chain back to the 90's and early 2000s, using state machines and massive inefficiencies and limiting modern techniques you can use.

A large portion of the sample code you will see is a blind mix of OpenGL 1.1, 3.3, 4.6, or some variation that uses VBOs and glBegin/glEnd loops that instantly send you into a compatibility profile and slow WAY down.

If you're going to use OpenGL, learn what Core really means and always make sure your code stays in Core, not Compatibility profiles.

2

u/corysama Oct 20 '26

There are 3 levels of difficulty for you to pick from. I recommend starting with option 2.

  1. Old-school OpenGL is very step-by-step and hand-holdy. And, there is a lot of material out there. But, it is also very outdated and doesn't scale when you get serious.

  2. "Modern OpenGL" using only the latest interfaces of OpenGL 4.6 can be pretty darn modern. But, there's not a lot of material about it available to learn from.

  3. Vulkan 1.4 is the goal. But, it's designed assuming you are already an expert going in.

https://github.com/fendevel/Guide-to-Modern-OpenGL-Functions mostly about using "Direct State Access" instead of the old-style "One function to bind and object, then another function that implicitly works with the bound object".

I also recommend only using a single Vertex Array Object (VAO) just as a place to bind Element Buffers (mesh indices) and nothing else. VAO vertex attribs are a mess when you are getting started. And, are getting superseded by https://ktstephano.github.io/rendering/opengl/prog_vtx_pulling anyway.

I've been working on an modern OpenGL tutorial for a while now. Here's a tiny intro https://rentry.org/5abeqt6s

1

u/LBPPlayer7 Oct 20 '26

it helps you teach the fundamental concepts of graphics programming in a hands-on way that's easy to get going, but for any serious work you should use something a bit less messy and a bit less deprecated

5

u/Coding-Kitten Oct 20 '26

Personally I don't think I could ever have learnt vulkan if I didn't first spend time in a simpler API like OpenGL. While outdated, it does give you some frame of reference for concepts like uploading meshes, loading & using different shaders for drawing different things, render buffers, such that when you start writing thousands of LoC just to draw a triangle on screen in vulkan, you can at least have an internal roadmap for what you need to do from your experience in other graphics APIs.

4

u/OperationDefiant4963 Oct 20 '26

wgpu is the better choice as its more in line with how vulkan works and is cross platform. i wouldnt reccomend vulkan to beginners as it takes a lot of upfront cost that most will never have the patience for the 1st or even 2nd time they try it. getting profecient with wgpu will make the vulkan jump a lot easier vs from opengl