AnselmoGPP / Vulkan_samples

Computer graphics projects using the Vulkan API

Repository from Github https://github.comAnselmoGPP/Vulkan_samplesRepository from Github https://github.comAnselmoGPP/Vulkan_samples

Vulkan sample projects


Khronos Vulkan logo

This is a collection of open source C++ projects for Vulkan®, the new generation graphics and compute API from Khronos®. It includes the dependencies needed for building a Vulkan project.

Table of Contents

Repository content

Content of this repository:

  • src: Different projects that use Vulkan
    • Vk_1: The very basics. Triangle
    • Vk_2: Buffers (Staging, Vertex, Index). Square.
    • Vk_3: Descriptors (layout, buffer, pool, sets). Rotating 3D square.
    • Vk_4: Texture mapping (image view and sampler). Rotating 3D textured square.
    • Vk_5: Depth buffering. Two rotating 3D texture squares at different heights.
    • Vk_6: OBJ models loaders. Loads a 3D scenario.
    • Vk_7: Mipmapping. In software generation.
    • Vk_8: Multisampling: Shader MSAA (MultiSampling AntiAliasing) & SS (Sample shading).
    • Vk_9: Abstracting Vulkan (environment, model, render loop).
    • Vk_10: Rendering many models simultaneously.
    • Vk_11: Camera system (free camera).
    • Vk_12: Render same model several times.
  • extern: Dependencies
  • files: Scripts and images
  • textures: Images used as textures in our Vulkan projects


Vulkan window

Dependencies

Dependencies of these projects:

  • GLFW (Window system and inputs)
  • GLM (Mathematics library)
  • stb_image (Image loader)
  • tinyobjloader (Load vertices and faces from an OBJ file)
  • Vulkan SDK (Set of repositories useful for Vulkan development) (installed in platform-specfic directories)
    • Vulkan loader (Khronos)
    • Vulkan validation layer (Khronos)
    • Vulkan extension layer (Khronos)
    • Vulkan tools (Khronos)
    • Vulkan tools (LunarG)
    • gfxreconstruct (LunarG)
    • glslang (Shader compiler to SPIR-V) (Khronos)
    • shaderc (C++ API wrapper around glslang) (Google)
    • SPIRV-Tools (Khronos)
    • SPIRV-Cross (Khronos)
    • SPIRV-Reflect (Khronos)

Building these projects

Steps for building this project:

The following includes the basics for setting up this project. For more details about setting up Vulkan, check Setting up Vulkan.

Ubuntu

  • Update your GPU's drivers
  • Get:
    1. Compiler that supports C++17
    2. Make
    3. CMake
  • Install Vulkan SDK
    1. Download tarball in extern\.
    2. Run script ./files/install_vulkansdk (modify pathVulkanSDK variable if necessary)
  • Build project using the scripts:
    1. sudo ./files/build_dependencies_ubuntu
    2. ./files/build_project_ubuntu

Windows

  • Update your GPU's drivers
  • Install Vulkan SDK
    1. Download installer wherever
    2. Execute installer
  • Get:
    1. MVS
    2. CMake
  • Build project using the scripts:
    1. build_dependencies_Win.bat
    2. build_project_Win.bat
  • Compile project with MVS (Set as startup project & Release mode) (first glfw and glm_static, then the Vulkan projects)

Adding a new project

  1. Copy some project from /project and paste it there
  2. Include it in /project/CMakeLists.txt
  3. Modify project name in copiedProject/CMakeLists.txt
  4. Modify in-code shaders paths, if required

Links

About

Computer graphics projects using the Vulkan API

License:MIT License


Languages

Language:C++ 88.1%Language:GLSL 9.9%Language:CMake 1.6%Language:Shell 0.3%Language:Batchfile 0.2%