Skip to content

jacquespillet/vulkan

Repository files navigation

Vulkan

This is a project I started to learn more about vulkan API. I started off just creating a regular glTF model viewer, but kept adding features, and it became more of a playground for exploration on rendering.

Renderers

Requirements

Visual Studio (Tested only on Visual Studio 2019) NVidia GPU (for RTX)

Build Instructions

### Clone the repo and checkout to the latest branch
git clone --recursive https://github.com/jacquespillet/vulkan.git
cd vulkan

### Generate the solution
mkdir build
cd build
cmake ../

### Build
cd ..
Build.bat

First build may take a while because it's going to build all the dependencies with the project.

Usage

VulkanApp.exe "path/to/your/model.gltf"

you can add another parameter to set the global scale of the scene, like so :

VulkanApp.exe "path/to/your/model.gltf" 0.01

Features

Renderers

It has 6 different "renderers" available :

  • Forward : The simplest one, it just does forward rendering using the vulkan graphics pipeline. It's using a pbr material shader. It also supports image based lighting, and directional lighting.

  • Deferred : Simple Deferred rendering pipeline, just to understand how offscreen render targets work in vulkan It also supports image based lighting, and directional lighting.

  • Path Tracer RTX A path tracer that uses the hardware acceleration features on new NVidia RTX gpus. It can also use Open Image Denoise to denoise the renders. It's a simple path tracer, but still able to produce some good looking images!

  • Path Trace CPU Well, that's the same path tracer as the previous one, but using the GPU.

As it cannot benefit from hardware accelerated ray tracing, it's using a custom BVH based on the great BVH series by Jacco Bikker.

  • Rasterizer CPU

As the title says, it's a rasterizer that runs on the cpu that renders the scene. It really has a limited set of features : Only draws the triangles with a simple lighting algorithm.

It is based on tinyRenderer

  • Path Tracer Compute

That's a path tracer that runs in a compute shader, and that doesn't use the hardware acceleration for ray tracing.

It also uses the same BVH structure as the cpu path tracer, and produces the same results as the other 2 path tracers.

Material system

The materials can be edited live in the editor

Material UI

Object Picking

Pixel perfect object selection, and ability to move objects in the scene using (ImGuizmo)[https://github.com/CedricGuillemet/ImGuizmo]

Gallery

Path Tracer

Image_1 Image_2 Image_3 Image_4 Image_5 Image_6

Forward & Deferred Renderers

Image_7 Image_8 Image_9

Scene Credits

Sponza by Frank Meinl, from glTF Samples

Damaged Helmet by theblueturtle_, from glTF Samples

Isometric Office by Companion_Cube

Big Room by Francesco Coldesina

List of dependencies

  • Assimp for 3D Model loading
  • GLFW for windowing system
  • gli for image loading and manipulation
  • glm for vector maths
  • imgui for user inferface
  • oidn for denoising path tracing output
  • stb for image loading
  • tbb needed by oidn
  • tinygltf for loading glTF scenes

Resources