University project to make a GPU raytracer.
This is a work in progress. Currently it can only render a set of spheres hardcoded in the shader. In addition most of the parameters for Vulkan are hardcoded and picked just so that it runs on the hardware I am testing on.
A compute shader is used to trace a ray for each pixel. The result is stored in an image, which is later copied to the framebuffer to be presented to the screen.
List of features:
- geometry: sphere
- geometry: triangle mesh
- material: opaque object
- material: transparent object
- light: point light
- light: rectangle light
VulkanandVulkan.hpp- graphics and computeGlfw3- window creationglsllangValidator- compiler from GLSL to SPIR-V
This project comes with an adhoc make + cmake build script, which will only work with clang or g++ because of hardcoded compiler flags and will probably only work on Linux.
-
install
vulakn,glfw3andglsllangValidatorsystem-wide.Vulkan.hppis automatically downloaded by the makefile. -
build with one of
make build make build PROFILE=release
-
or build and run with one of
make run make run PROFILE=release
I may fix it someday if I find an adequate build system for C++.