Giter Club home page Giter Club logo

steelengine's Introduction

SteelEngine

Physically-based render engine based on Vulkan API and Nvidia RTX.

Overview

This is a sandbox for self-education. Two different rendering methods have been implemented:

  • Path Tracing - simple backwards Monte Carlo path tracing
  • Hybrid Rendering - classical rasterization with ray queries

Both of them use a physically-based lighting model and there is an ability to switch between them in runtime.

General Features

  • Free camera control
  • GLTF scene loading
  • HDR environment maps
  • Directional light detection
  • Point lights visualization
  • Runtime shaders reloading

Path Tracing

Path tracing is based on the Vulkan ray tracing pipeline, which is provided by VK_KHR_ray_tracing_pipeline extension.
Currently, path tracing doesn't have any runtime denosing, there is just a simple result accumulation when camera the doesn't move.

Hybrid Rendering

Drawing phase

Hybrid rendering uses classical g-buffer approach. G-buffer consists of folowing set of textures:

  1. R10G10B10A2unorm - normals
  2. R11G11B10sfloat - emission
  3. R8G8B8A8unorm - albedo + occlusion
  4. R8G8unorm - roughness + metallic
  5. D32sfloat - reverse depth

World space positions are restored from the depth, which is reversed to keep a precision in whole range of values.

Lighting phase

Scene lighting executes in compute shader and in general represents typical PBR. Lighting consists of direct light: lighting from directional and point light sources, and indirect light. For direct lighting there are simple hard shadows that are calculated using ray queries. Indirect lighting aka global illumination uses preconvolved IBL textures and set of captured light probes that form a light volume.

Light volume is generated according to the following steps:

  1. Detecting optimal positions for light probes depending on scene geometry
  2. Capturing a probe from each position into a cupemap using a path tracing method
  3. Converting probe cubemaps into an array of 3rd order spherical harmonics
  4. Generating a tetrahedral mesh from probes point cloud

During runtime, the irradiance of the specific point is calculated by detecting the tetrahedron, inside which this point is located, and interpolating this tetrahedron's 4 light probes using barycentric coordinates. Specular part of indirect lighting is obtained by renormalizing IBL specular value using the light volume's irraidance.

Light volume can be visualized.

Gallery

Path Tracing

San Miguel 1 San Miguel 4
San Miguel 3 San Miguel 2

Hybrid Rendering vs Path Tracing

Cornell Box_Hybrid Cornell Box_PathTracing

Modern Sponza_Hybrid Modern Sponza_PathTracing

External Libs

Bibliography

steelengine's People

Contributors

extinctionhd avatar eqxbarboss 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.