Git Product home page Git Product logo

kaguya's Introduction

Kaguya

This is a hobby project using DirectX 12 and DirectX RayTracing (DXR). This project is inspired by Peter Shirley and his ray tracing book series: In One Weekend, The Next Week, The Rest of Your Life, Alan Wolfe's blog post series on causual shadertoy path tracing and lastly Physically Based Rendering: From Theory to Implementation by Matt Pharr, Wenzel Jakob, and Greg Humphreys. For those of you who haven't read any of these and would like to explore ray tracing, I highly recommend them!

Features

  • Progressive stochastic path tracing
  • Importance sampling of BSDFs and multiple importance sampling of lights
  • Lambertian, Mirror, Glass, and Disney BSDFs
  • Point and quad lights
  • ECS with the following implemented components:
    • Tag: used to identify a game object
    • Transform: controls position, scale, orientation of GameObject
    • Camera: controls camera parameters for scene viewing
    • Light: used to illuminate the scene, controls light parameters
      • Supported types:
        • Point
        • Quad
    • Mesh Filter: references a mesh in the asset window to be rendered
    • Mesh Renderer: controls material parameters and submits the referenced mesh to RaytracingAccelerationStructure for path tracing
      • Supported BSDFs:
        • Lambertian
        • Mirror
        • Glass
        • Disney
    • NativeScript: C++ scripting
    • Collider: Adds collider to the entity to detect collisions with other rigidbodies with a collider
      • Supported Collider:
        • Box Collider
        • Capsule Collider
        • Mesh Collider (WIP)
    • Rigid Body: Adds rigidbody physics to the entity and can be applied forces and velocities
      • Static Rigid Body
      • Dynamic Rigid Body
  • Custom scene serialization using json
  • Asynchronous resource loading
  • Bindless resource
  • Utilization of graphics and asynchronous compute queues
  • Acceleration structure compaction

Goals

  • Implement spectral path tracing
  • Implement bi-directional path tracing
  • Implement wavefront path tracer
  • Implement volumetric scattering and sub-surface scattering
  • Implement anti-aliasing techniques
  • Implement more materials
  • Implement more light types (spot, directional, spherical)
  • Implement denoising
  • Implement custom memory allocator for D3D12 based on resource usage
  • Implement D3D12 resource residency management
  • SM6.6 Dynamic resource binding
  • Add environment lights (Portal-masked environment map sampling) and geometry area lights (Spherical triangle sampling)
  • Upgrade from DXR 1.0 to DXR 1.1 (inline raytracing)

Build

  • Visual Studio 2019
  • GPU that supports DXR
  • Windows SDK Version 10.0.19041.0
  • Windows 10 Version: 20H2
  • CMake Version 3.15
  • C++ 20
  1. Initialize submodules after you have cloned, use CMake GUI to configure and generate visual studio solution. (I ran bfg-repo cleaner on this repo because I was committing all my assets, the repo is way smaller now with the downside of unable to see old commit file changes)

  2. Download assets from ProjectAssets repo and extract the contents into a directory named assets in the root directory of the repo. (There's a build event that'll copy contents from asset to the executable directory)

  3. When the project is build, all the assets and required dlls will be copied to the directory of the executable. There is a folder containing all the scenes in the asset directory for the showcase, those can be loaded from the context menu of the Hierarchy window of the application's UI.

Let me know if you have any trouble setting up the project and getting it up and running!

Acknowledgements

Thanks to Benedikt Bitterli for rendering resources!

References

Implementation details

Showcase

0 1 2 3 4

kaguya's People

Contributors

kcloudy0717 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.