Giter Site home page Giter Site logo

vulkan's Introduction

Path tracing and global illumination using Vulkan

enter image description here enter image description here enter image description here enter image description here

Initially, I started this project to learn Vulkan and wrote a sandbox engine for trying out things in Vulkan.

I started by forking Sascha Willems' excellent resource: https://github.com/SaschaWillems/Vulkan. I would recommend this as the first stop, bar none, for anyone trying to learn Vulkan.

As I got more familiar with Vulkan, I also decided to get back into Ray Tracing and Global Illumination, and the project diverged.

I used these as reference:

This project currently has fundamentally just 2 parts:
-The 'genesis' engine, which is the set of classes encapsulating core Vulkan functionality like buffers, textures, images, shaders, gltf and so on.
-The ray tracing application that uses this engine.

The sample continues to increase in functionality. Currently it supports:

  • Diffuse and Specular brdfs specified the PBR/gltf way (metalness, roughness, etc) and some support for transmission.

  • World building specification (which leads itself to indirect rendering as well):
    -There can be multiple models (a 'model' is typically a single gltf file, but in theory it can come from anything or even runtime created)
    -There can be multiple instances of such models
    -Multiple instances of multiple models go into cells
    -There can be multiple cells

  • You can switch between ray tracing and rasterization. Rasterization uses indirect rendering.

  • Everything is bindless. I used Nvidia's buffer reference extension: https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_buffer_reference.txt
    -Vertex and index buffers for multiple models go into multiple buffers
    -Material (properties, textures) for multiple models go into a buffer of materials
    -There is a buffer of instances (corresponding to instances of models in a cell)

Prerequisites

You need an RTX card with the latest drivers and also need the Vulkan SDK

Cloning

This repository contains submodules for external dependencies, so when doing a fresh clone you need to clone recursively:

git clone --recursive https://github.com/pprabhu78/Vulkan

Existing repositories can be updated manually:

git submodule init
git submodule update

Building

The repository contains everything required to compile and build the examples on Windows, Linux.

On windows, you generate the solution using: cmake -G "Visual Studio 17 2022"

I have not compiled, tested on linux.

Assets

There are a handful of models in the data/models folder. You can use other gltf models. For example: https://github.com/KhronosGroup/glTF-Sample-Models

You can create and/or export glTF in Blender (or any other modeling software)

You can drag and drop .glb or .gltf files onto the application.

Running

Once built, the application can be run from the bin directory. `

Credits and Attributions

Huge thanks to all the entities mentioned in above for everything. See CREDITS.md for additional credits and attributions.

PS: The name of the engine is a nod to the 'genesis effect' from Star Trek II: The Wrath of Khan enter image description here which was the first fully textured CGI effect in film.

vulkan's People

Contributors

1ace avatar aleksy-sokolowski avatar baldurk avatar ben-clayton avatar billhollings avatar cforfang avatar chrisforbes avatar christianf-arm avatar daemyung avatar dcbaker avatar diharaw avatar ekzuzy avatar elect86 avatar hevrard avatar iostrowsintel avatar jarredhdavies avatar jherico avatar krooze avatar liuhongyi0101 avatar mattguerrette avatar neither-nor avatar per-mathisen-arm avatar pprabhu78 avatar prideout avatar roboman2444 avatar saschawillems avatar shoufengyang avatar tomek-brcm avatar vzout avatar yanchith avatar

Stargazers

 avatar

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.