Vulkan Renderer
This project was my first time working with Vulkan. I implemented the tutorial available on vulkan-tutorial.com in a new project, separate from any existing project, in order to focus on understanding how Vulkan works and link elements to my current knowledge of graphics programming and other APIs like DirectX 11 and 12. I skipped the last chapter about compute shaders, as it was going out of scope for this project.
Implemented features
Setting up a Vulkan graphics pipeline
Use of vertex buffer
Use of index buffer
Use of uniform buffers
Use of depth buffer
Loading models and texture mapping
Generating and using mipmaps
Multisample Anti-Aliasing (MSAA)
Credits
All credits to the website vulkan-tutorial.com for their code and the resources they used. The images showed below comes from their website too, to more easily show the effects of mipmaps and MSAA.
Rendering a model
After setting up the pipeline, a render pass, loading a model and it's texture, filing the vertex buffer and index buffer and binding everything together, this was the first 3D render of the project. It does not have mipmaps or MSAA yet, which will be added in the next sections.
Generating and using mipmaps
Mipmaps can be used in order to reduce some artefacts related to the texture, like a flickering on a far moving object. They are lower resolution versions of the original texture. The further the rendered triangle, the smaller resolution texture will be used. This basically blurs the pixels of the texture to reduce the flickering effect caused by a pixel's color changing too fast from frame to frame due to movement for example. The effect of mipmaps is not the most obvious here, as the scene isn't really deep.
Applying MSAA
MSAA, or Multisample Anti-Aliasing is used in order to smooth the edges of a model, by sampling each pixels at multiple locations, and not only it's center. The more of those sample points are inside the rendered triangle, the more opaque the color will be. This usually leaves a border of semi-transparent pixels around the triangle that softens the jagged "staircase" effect on the edges, and make them appear smoother. Of course, the more sample points, the heavier the computation becomes, so it is important to find the correct balance between quality and performance.