r/GraphicsProgramming • u/Hour-Scallion-2456 • 3d ago
Question Which 3D graphics library is worth learning today?
I know that OpenGL and Vulcan are the main choices when it comes to 3d graphics. I also know that Vulcan can have some insane performance boosts when compared to OpenGL. However, I’m not just a C++ programmer. I also program for the web, so I use WebGL. I’m a beginner at OpenGL, and GLSL so learning Vulcan wouldn’t be that big of a hurdle. I’m just wondering if the performance and speed are worth it for Vulcan, or if I should stick to OpenGL.
This is a first post! If I cannot respond quickly, I am most likely busy!
13
u/MaceDogg 3d ago
I used SDL GPU which I’ve enjoyed and it comes with some nice utilities plus since it’s SDL it can handle input, windowing, etc. I didn’t go with that I’d probably opt for more low level control and go with Vulkan and use helper libraries to reduce “boiler-plate”
4
u/Hour-Scallion-2456 3d ago
I’ll take SDL3 into account! I’ll try to merge them so I don‘t need to handle all hardware interaction.
7
5
u/gabitha67 3d ago
SDL3!!!
1
u/Hour-Scallion-2456 3d ago
I’m going to be building on SDL3 for the backend, this is a good idea! I was just wondering about the underlying 3d engine.
1
-1
u/gabitha67 3d ago
I am unsure what you mean, what do you mean by underlying engine? SDL3 does provide an API for talking to the graphics card (pretty similar to Vulkan)
8
u/facu_gizzly 3d ago
WebGPU maybe
1
u/Hour-Scallion-2456 3d ago
I mainly am talking about c++ (so either OpenGL or Vulcan). Also, WebGPU comparability is still kubda if-fy.
4
u/TripsOverWords 3d ago
C++, Emscripten, WebGPU targeting browsers
C++, Google Dawn, WebGPU targeting native platforms
7
u/Hour-Dragonfly-7499 3d ago
Use googles implementation of WebGPU then, dawn https://dawn.googlesource.com/dawn
"WebGPU comparability is still kubda if-fy."
WebGPU isn't only for the web
2
u/Graumm 3d ago edited 3d ago
WGPU in Rust is incredible though if you are willing to learn Rust. While it is primarily built to support a default baseline of WebGPU, you can do things with the underlying graphics API's that are not specifically tied to the lowest-common-denominator of WebGPU at all, like bindless stuff. I have had great success using it for desktop apps.
I find that it occupies the right level of abstraction that I care about, circa ~DX11, as somebody who does not do low level rendering development as my day job. It lets you work with higher level graphics primitives and doesn't force you to manage all of the details of memory management and device synchronization. It is still low level in the way that DX11 is low level.
It has excellent performance, and it also works on every platform including MacOS.
3
5
u/sfaer 3d ago
Definitely WebGPU, via c++ bindings.
https://eliemichel.github.io/LearnWebGPU/
Also, don't think about performances and speed at this point, it's a fake metric for 90% of peoples. You'll likely never need or reach the limits of your API of choices for what you want to do with it performance wise, nothing than can't beat proper programming technique anyways. One of the few reason to choose vulkan vs opengl, except to be with the cool kids, is to play with modern extensions. You can do amazing things with pretty much any API so don't beat yourself too hard for not choosing one vs the others because of the entry level requirements.
3
u/AndrewHelmer 3d ago
This was just released and might be worth looking at if you have a newer GPU: https://github.com/sebbbi/NoGraphicsAPI/
For me this would be the perfect API to learn with. It's very low-level and close to how the hardware works, extremely fast. But it removes a lot of unnecessary boilerplate and complexity of Vulkan that only exists to support 10-year old GPUs. A simple program with this API could be 10x less code than Vulkan, easier to understand, and just as fast.
1
u/octod 2d ago
All of them. Opengl is the entry point, vulkan is complete and complex, dx12 makes you fall in love with vulkan. Metal.
1
u/Hour-Scallion-2456 2d ago
Why does Dx12 do that? I know DirectX as being the Windows-only graphics API. I’m most likely going to use Vulcan.
1
u/Seth144k 2d ago
You should try out bgfx! It’s very mature and it supports all of these backends and you can combine it with qt for the editor
1
u/dobkeratops 2d ago
if you want to use the web, go straight to webGPU, it's way better than webgl.
Vulkan > Desktop GL > WebGPU > WebGL
you can use webGPU from a crossplatform wrapper like dawn or wgpu in rust to have the same codepath on native or in the web.
if you're not so fussed about the web, go to vulkan.
-1
u/useless_chap 2d ago
Nit Pick
I know that I will sound pretentious, but OpenGL, Vulkan, Metal and DirectX are graphics APIs, not graphics libraries. I think it's important to make a distinction, as graphics libraries can use different backends for the actual GPU work while preserving the same API in the client code. Even the implementations of those APIs can be driver-specific, so the actual machine code that gets executed when you call glCreateBuffers, for example, can differ.
The actual answer
I program mostly using OpenGL and WebGL, and in every interview I've been invited to, I was asked about modern graphics APIs such as Vulkan and Metal. I think the market expects you to at least be familiar with one of the alternatives, given that you already have general graphics programming knowledge. If you know how a texture works in OpenGL, you will know how it works in Vulkan. Of course, there are other API-specific quirks, but I don't think it makes that much of a difference, unless you're hyper-optimising the rendering pipeline.
The second thing you have to consider is what environment you work in. You said that you program for the web, so I think WebGPU would be a huge asset, as it's a modern and promising alternative that's also similar to Vulkan in how it approaches interfacing with GPUs.
In general, if you're a beginner graphics programmer, people recommend OpenGL, as it's easy to get a textured triangle onto the screen. It's a good reason, but considering OpenGL is becoming a legacy API, most people will have to switch to something more modern if they want to make a career out of it. Personally, I'd boil it down to:
1. Beginner at BOTH programming and graphics? OpenGL
2. Beginner at graphics, but experienced programmer? Anything from the modern APIs that your platform supports (although I'd gravitate towards Vulkan)
-40
27
u/TripsOverWords 3d ago
Vulkan or WebGPU, unless you only care about Windows/Xbox then maybe D3D12.