OpenGL vs Vulkan
When learning the Graphics API for the first time, the question of which API to choose to learn about graphics and its capabilities will always come up. I'll attempt to shed some light on which one would be best for your needs in this little article.
There are primarily two options to consider while studying the graphics API: Vulkan and openGL. Let's delve a little deeper.
Open Graphics Library (OpenGL) is a cross-language /cross-platform API for rendering 2D and 3D vector graphics. Typically, these API is used to communicate with a graphics processing unit (GPU) to accomplish hardware-accelerated rendering.
The Vulkan API is a low-overhead, cross-platform 3D graphics and compute API. This API targets high-performance real time 3D graphics applications such as video games and interactive media across all platforms. This cross-platform API has the potential to significantly enhance 3D performance on some hardware, particularly multi-core application processors found in billions of smartphones and tablets.
Vulkan is the new generation, open standard API for high-efficiency access to graphics and compute on modern GPUs. Previously referred to as the Next Generation OpenGL Initiative, Vulkan provides applications direct control over GPU acceleration for maximized performance and predictability.
Vulkan is the new generation, open standard API for high-efficiency access to graphics and compute on modern GPUs. In order to enhance efficiency and predictability, Vulkan, formerly known as the Next Generation OpenGL Initiative, gives programmers direct control over GPU acceleration.
The benefits of Vulkan for game developers revolve around how much more control they offer. Some advantages of Vulkan over OpenGL include the following:
a) The API intends to generate command buffers across many threads and process them simultaneously to a command pipeline. The majority of highly regarded and effective software that is based on OpenGL operates according to a similar principal. The developers do not have to maintain the framework because the API has taken it upon itself to display this behavior, and even if they do, they can do it easily.
b) When compared to OpenGL, Vulkan is much more predictable; rendering is uninterrupted. As soon as the driver receives the jobs, they are submitted upfront.
Recommended by LinkedIn
c) The application developer must select the proper memory type for each resource's intended usage because Vulkan is able to expose a variety of memory types on the system. In contrast, OpenGL drivers allocate resources based on internal algorithms that can differ between vendors, and if the driver adjusts the resource later, it may result in a less-than-ideal placement or unanticipated issues.
d) The application programme itself handles thread/memory management, therefore the driver need not interfere. This implies that the API's behaviour may be modified to meet the demands of the game.
e) Vulkan supports mobile and desktop rasterizers as an integrated part of the implementation. Along with native tiling-based feed-forward rasterizers, it enables tile-based or delayed rasterizers for embedded devices. since there is no obvious API difference between the mobile and desktop versions, cross-platform game porting will be simpler.
When compared against Vulkan in terms of draw calls per second as well as overall driver overhead, OpenGL still has a chance to compete with Vulkan.
a) Driver overhead has been significantly reduced by recent OpenGL enhancements. It accomplishes this by making everything bindless (using ARB direct state access, ARB bindless texture, etc.).
b) By using persistent mapping, it is ensured that the CPU may access buffer memory directly and that its synchronization with the GPU is explicit, which is quite similar to Vulkan.
If your goal is to develop a game/Game engine, OpenGL will help you beginning to build rendering algorithms i.e. shading, transform etc. more quickly. The driver will make every effort to reduce this effect even if the API occasionally prevents you from being as effective as you may be. Even though it's a very hazy line, unless you're trying to get the most out of your CPU or GPU, it probably won't damage you.
OpenGL is not a great choice to start with if your objective is to learn how GPUs function because it doesn't offer good abstraction. Vulkan will help you make sense of all the little things the driver has to think about. There's less magic going on, fewer hidden operations that will come back to bite you. If you're going to do something inefficient, you'll have to do it deliberately.
If your goal is to learn how GPUs work, then Vulkan would be a good choice. Vulkan would help you in making sense of all the little considerations the driver has to think about.
So Vulkan is basically like Linux but good and OpenGL is Windows?
Like Roman Popov said, i would never suggest a beginner to start with Vulkan. You need to understand a lot of things just to draw a triangle. Also, the code required to just draw a triangle is huge. Vulkan is for experts, like Vikas Patel mentioned, it's only for people who want greater control on everything and purpose is not learning, but getting best of the available GPU.
It took me about a month of weekends to draw a triangle in Vulkan. So I think its is almost always a bad idea to start learning GPU APIs with Vulkan. (Unless you need to ramp up with codebase that uses Vulkan). Learning core concepts of GPU pipeline and GLSL will be much easier with learnopengl.com and shadertoy.com