Coder Social home page Coder Social logo

karimio / vulkan-raytracer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 655 KB

A raytracer built with Vulkan and C++20 modules that supports realtime compute-shader-based raytracing with multi-bounce and multi-ray per pixel. We only support spheres for the time being.

GLSL 3.25% C++ 22.01% CMake 0.60% C 74.14%
cgi graphics graphics-programming raytracing raytracing-engine vulkan vulkan-api

vulkan-raytracer's Introduction

Raytracer Test

A raytracer built with Vulkan and C++20 modules that supports realtime compute-shader-based raytracing with multi-bounce and multi-ray per pixel.

You can control the camera using WASD / Arrow keys, and the mouse. Tab will toggle input. Escape will quit the application.

A demo image

Roadmap

  • Load models from glTF files
  • Depth of Field
  • Controls GUI
  • Textures
    • Texture Infrastructure
    • Albedo Texture
    • Normal Texture
    • Metallic Texture
    • Roughness Texture
  • Importance Sampling
  • Other methods of reducing noise

How to Build

If you'd like to build without cmake, use this guide.

Build Shaders

When building using cmake, you can run the BuildShaders target.

Alternatively, you can also just run the following commands with ... replaced with relevant paths and x.x.x.x replaced with relevant version:

.../VulkanSDK/x.x.x.x/Bin/glslc.exe -fshader-stage=vertex Fullscreen.vert.glsl -o Fullscreen.vert.spv
.../VulkanSDK/x.x.x.x/Bin/glslc.exe -fshader-stage=fragment Fullscreen.frag.glsl -o Fullscreen.frag.spv
.../VulkanSDK/x.x.x.x/Bin/glslc.exe -fshader-stage=compute Raytracing.comp.glsl -o Raytracing.comp.spv

Build Project

  1. Download and install Vulkan.
  2. Run CMake in the root directory of this project, where CMakeLists.txt is.
  3. Open the Solution.
  4. Open the properties for VulkanRaytracer. Set C/C++ > Code Generation > Floating Point Model to be blank.
  5. Build glfw, and then build VulkanRaytracer

Libraries and APIs used

References and Thanks

PBR and Raytracing

Vulkan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.