Voxelers / 3d

3D in Voxelers
Apache License 2.0
9 stars 1 forks source link

Learn Vulkan #29

Open acs opened 3 years ago

acs commented 3 years ago

https://www.khronos.org/blog/beginners-guide-to-vulkan http://stephaniehurlburt.com/blog/2017/7/14/beginner-friendly-vulkan-tutorials

https://www.khronos.org/registry/vulkan/specs/1.1/refguide/Vulkan-1.1-web.pdf https://github.com/KhronosGroup/Education-Forum https://www.youtube.com/watch?v=J8qvgHyechs https://github.com/LunarG/VulkanSamples

acs commented 3 years ago

Vulkan resources: https://github.com/KhronosGroup/Khronosdotorg/blob/main/api/vulkan/resources.md

acs commented 3 years ago

Ok, let's start with: https://vulkan-tutorial.com/Introduction

Extra step: sudo apt-get install libxxf86vm-dev

acs commented 3 years ago

Probably the next one must be: https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/html/index.html

acs commented 3 years ago

https://github.com/SaschaWillems/Vulkan http://www.vinjn.com/awesome-vulkan/

acs commented 3 years ago

Ok, let's close the Vulkan tutorial to understand howto share global variables between the program executed in the CPU and the shaders, howto load textures and howto load models from OBJ files. After that, I need to think in the next steps. I would like to compare the cube render version between OpenGL and Vulkan. Let's see!

Now stopped at: Uniform buffer

acs commented 3 years ago

There are tutorial about CG concepts that are the same in OpenGL and Vulkan: https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

So once you are comfortable with Vulkan, may OpenGL concepts can be implemented over it.

acs commented 3 years ago

Ok, let's put some effort with the LunarG tutorial: https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/html/00-intro.html. LunarG is the Vulkan implementation used in Linux, so it is a reference in Vulkan world.

First step is to have the ability to run the samples at:https://github.com/LunarG/VulkanSamples

Comparing:

https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/html/01-init_instance.html https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Instance

the are pretty similar. Probably LunarG one is a bit more detailed, and the Vulkan tutorial is more friendly. And I find easier to configure the compile environment for the Vulkan tutorial and it does not use extra components like the Vulkan-Loader or Vulkan-Headers. And the Vulkan tutorial explains better the integration with he native windowing system using the glfw.

But for example I find it more clear this description of Vulkan queues https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/html/03-init_device.html

«Unlike other graphics APIs, Vulkan exposes device queues to the programmer so that the programmer can decide how many queues to use and what types of queues to use.

A queue is the abstracted mechanism used to submit commands to the hardware. You will see later how a Vulkan application builds up a command buffer full of commands and then submits them onto a queue for asynchronous processing by the GPU hardware.»

Also it includes diagrams like https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/images/Device2QueueFamilies.png which helps understanding the concepts.

And talking about the command buffers https://vulkan.lunarg.com/doc/view/1.2.154.0/linux/tutorial/html/04-init_command_buffer.html it is more clear this high level description than the one I found in Vulkan Tutorial.

Ok, the LunarG tutorial provides a better high level vision so it is easier to understand how Vulkan really is designed and works.

acs commented 3 years ago

Ok, I am starting my own Vulkan insights to be sure I understand correctly the full picture: https://docs.google.com/document/d/1gNeNC6kt1cLNGemiDKJ3t9xFdC1RY1w4oTx5OiEJnfs/edit?usp=sharing