Giter VIP home page Giter VIP 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!

Showcase

0 1 2 3 4

Features

Graphics

  • Render graph system
  • Progressive stochastic path tracing
  • Importance sampling of BSDFs and multiple importance sampling of lights
  • Lambertian, Mirror, Glass, and Disney BSDFs
  • Point and quad lights
  • Real-time path tracing using both DXR 1.0 and DXR 1.1

D3D12

  • Bindless resource
  • Asynchronous PSO compilation using coroutines and threadpools
  • Utilization of graphics and asynchronous compute queues
  • Acceleration structure compaction using modified RTXMU

Misc

  • Custom scene serialization using json
  • Custom binary format for loading meshes and meshlets
  • Asynchronous asset importing using threads
  • Asset management using lightweight handles

World

  • Ecs with the following implemented components:
    • Core: Main component that all actor in the scene have, it contains tag that identifies the actor and a transform which controls position, scale, and orientation
    • Camera: controls camera parameters for scene viewing
    • Light: used to illuminate the scene, controls light parameters
      • Supported types:
        • Point
        • Quad
    • Static Mesh: references a mesh in the asset window to be rendered and controls material parameters and submits the referenced mesh to RaytracingAccelerationStructure for path tracing
      • Supported BSDFs:
        • Lambertian
        • Mirror
        • Glass
        • Disney
    • NativeScript: C++ scripting

Build

  • Visual Studio 2019. I am using VS 2022, but 2019 should still work.
  • GPU/Driver that supports DXR.
  • Windows SDK Version: 10.0.19041.0
  • Windows 10 Minimum Version: 20H2. I am on Windows 11 insider build, older version should still work.
  • CMake Version 3.16 or up. Make sure the option "Add CMake to the system PATH for all users" during installation.
  • C++ 20
  1. Initialize submodules after you have cloned, obtain assets used by the project from here: Assets and copy the Assets folder to the root repo folder. use Setup.bat to generate visual studio solution (Make sure you have CMake installed and is a environmental variable).

  2. 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 World window of the application's UI.

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

Future stuff to work on

  • GPU driven architecture
  • Deferred renderer
  • Hybrid renderer (Raster & Raytracing)
  • Explore spectral rendering and all kinds of integrators mentioned in PBRT
  • Add physx back into World system
  • Mesh shading using meshlets
  • Vulkan support

Acknowledgements

Thanks to Benedikt Bitterli for rendering resources!

References

Implementation details

kaguya's People

Contributors

kcloudy0717 avatar

Watchers

 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.