Skip to content

Simple Vulkan ray tracer combined with PBR raster renderer governed by nice editor

License

Notifications You must be signed in to change notification settings

wpsimon09/Vulkan-RTX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vulkan RTX

Simple Vulkan physically based render that can render meshes in classic rasterisation pipeline. But also contains Ray tracer that renders the scene on the full screen Quad by utilising the ray tracing technology.

The goal is to eventually transition from a purely shader-based ray tracing implementation to leveraging Vulkan's dedicated ray tracing pipeline

Used technology

  • Rendering API - Vulkan (vulkan.hpp)
  • Shading Language - Slang
  • Language - C++
  • Math - glm
  • Dear::ImGui - User interface

Notes

  • Current code needs quite a lot of refactoring and simplification.
  • Ray Tracer does not yet represent the scene that is rendered with raster pipeline
  • Ray Tracer does not yet use accumulated average to de-noise the rendered image
  • This is quite silly project for me to learn how ray tracing and Vulkan works

Build

1. Clone this repo

git clone https://github.com/wpsimon09/Vulkan-RTX.git --recursive  ## recursive has to be there 

2. Download GLFW

  • this library is used for window creation and provides context for Vulkan

On windows

On Linux

# On Ubuntu/Debian:
sudo apt update && sudo apt install -y libglfw3 libglfw3-dev

# On Arch Linux:
sudo pacman -S glfw --noconfirm

# On Fedora (Red Hat-based distros):
sudo dnf install -y glfw glfw-devel

# On openSUSE:
sudo zypper install glfw-devel

3. Build the project

cd Vulkan-RTX ## navigate to repo
mkdir build ## create build directory
cd build ## go to the build directory
cmake -DCMAKE_BUILD_TYPE=Release -S ../ -B . ## write build files
cmake --build .

4. Compile shaders

Download slang for your OS from here

For windows

  • modify the $SLANGC_PATH in compileSlang.ps1 to point to the slangc.exe that you have just downloaded
  • run the powershell script compileSlang.ps1
cd ./Shaders
Set-ExecutionPolicy Unrestricted -Scope Process
.\compileSlang.ps1

For Linux

  • run the shell script in Shaders directory
  • modify the $SLANGC_PATH in compileSlang.sh to point to the slangc that you have just downloaded
cd ./Shaders
chmod +x compileSlang.sh
./compileSlang.sh

Little showcase

Editor

image

image

RTX OFF

image

RTX ON

image

About

Simple Vulkan ray tracer combined with PBR raster renderer governed by nice editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages