Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo

Overview

Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo

Daqi Lin

This demo is for the I3D 2019 paper Real-Time Rendering with Lighting Grid Hierarchy (Lin & Yuksel, 2019). The project page of the paper can be found at https://dqlin.xyz/pubs/2019-i3d-LGH/.

For a CPU version of lighting grid hierarchy, please visit https://github.com/cemyuksel/cyCodeBase/blob/master/cyLightingGrid.h.

This demo is built upon MiniEngine by Team Minigraph at Microsoft.

Images produced by this demo:

Default demo scene with a teapot added (see additional notes)

San Miguel scene from the McGuire Computer Graphics Archive

System Requirements

  • Windows 10
  • Visual Studio 2017 with Windows 10 SDK version >= 17763
  • DXR compatible graphics card, RTX 2060 or higher is recommended
  • For non-DXR compatible graphics cards, the application will try to enable the fallback layer, but the fallback layer is not guaranteed to work. See the fallback layer requirements here and the discussion in this thread.

Libraries Used

  • ZLib
  • WinPixEventRuntime
  • Assimp 3.3
  • FreeImage 3
  • TinyXml
  • GLM

If the prebuilt binaries do not work with your computer, you should easily find them online.

Run the Demo:

  • To run the demo, enter the LGHDemo folder and open LGHDemo.exe.
  • In command lines, run "LGHMemo.exe <XResolutionxYresolution>", for example, "LGHDemo.exe 1920x1080", to change rendering resolution.
  • In command lines, run "LGHDemo.exe <YourSceneDecsription>.xml" to view a custom model rather than the demo scene. A file "SceneDescription.xml" is provided as the template. Current application only supports one directional light and one perspective camera.

Build the Demo:

  • Open LGHDemo/LGHDemo.sln in Visual Studio 2017 or above (may need to upgrade the solution)
  • Choose configuration: Debug, Profile or Release
  • Build the solution (x64 platform is assumed)

Controls

  • Forward/backward/strafe: WASD (FPS controls)
  • Up/down: E/Q
  • Yaw/pitch: mouse
  • Toggle slow movement: lshift
  • Open/close demo settings menu: backspace
  • Show/hide frame rate: =
  • Navigate debug menu: use up/down arrow keys to go through menu items, use left/right to fold/unfold submenus
  • Toggle debug menu item (boolean type, the toggled state looks like [X]): return
  • Adjust debug menu value (numeric or enum type): left/right arrow keys
  • Navigate to "Save Settings" and press enter to save current settings to a file called "SavedSettings.txt"
  • Navigate to "Load Settings" and press enter to load settings from "SavedSettings.txt", assuming it exists
  • Navigate to "Display Profiler" and press enter to open the profiler menu. Use numpad 5123 as arrow keys to navigate
  • Press ESC to exit the demo

Demo Settings

Application

All options related to techniques used in the paper.

Debug View : Iterate through 4 different debug views for shadow sampling - stochastic and filtered results of unshadowed and shadowed indirect lighting.

Direct Lighting Only : Switch off all indirect illumination.

Enable Indirect Shadow : Switch on shadow in indirect illumination.

Enable Shadow TAA : Switch on temporal anti-aliasing for indirect illumination shadow, see section 4.3 last paragraph in the paper.

Enable Temporal Random : Enable this to change pseudo-random seed for shadow sampling in every frame. Deterministic bias for indirect shadow sampling can be eliminated when this is on. It is recommended to combine this with Shadow TAA and SVGF filtering.

Filter Type for Shadows : Iterate through 3 different shadow filters available: wavelet À-trous filter [Dammertz et al., 2010], Spatiotemporal Variance-Guided Filtering (SVGF) [Schied et al., 2017] and a naive bilateral filter [Heitz et al., 2018].

Filtering : Options for shadow filtering.

  • Interleave : Parameters for generating the discontinuity buffer used for geometry-aware Gaussian blur in filtering interleaved sampling patterns.

    • NDiff : Normal difference threshold. A lower threshold causes less tolerance in normal difference for determining geometry discontinuity.
    • ZDiff : Depth difference threshold. A lower threshold causes less tolerance in depth difference for determining geometry discontinuity.
  • SVGF : Parameters for the SVGF filtering.

    • CPhi : Lower value causes the bilateral filter more sensitive to color difference.
    • NPhi : Lower value causes the bilateral filter more sensitive to normal difference.
    • PPhi : Lower value causes the bilateral filter more sensitive to positional difference.
  • Wavelet : Parameters for the Wavelet À-trous filtering.

    • CPhi : Lower value causes the bilateral filter more sensitive to color difference.
    • NPhi : Lower value causes the bilateral filter more sensitive to normal difference.
    • PPhi : Lower value causes the bilateral filter more sensitive to positional difference.
    • Strength : Chooses from 3 different levels of filter strength. 0 - use the unfiltered input as the guidance image for detecting color difference, 1 - an interpolation between between 0 and 2, 2 - always use the filtered output as the guidance image for the next iteration.

LGH : Sets parameters for lighting grid hierarchy construction, lighting computation and shadow sampling.

  • Alpha : The blending parameter for blending different LGH levels. Larger value improves the accuracy of the result.

  • Build Source : Choose between "From S1" (Gather from S1) and "From VPLs" (Scatter VPLs). See section 3.1 in the paper. WARNING: Choosing "From VPLs" might cause your GPU to reset due to timeout, since this method is extremely slow.

  • DevScale : Adjust the scaling factor for the standard deviation of LGH shadow sampling. Using a smaller DevScale increases bias in shadow, but reduces the variance.

  • Draw Levels : Choose between "Skip VPLs" and "Include VPLs". See section 4.1 in the paper. Choose "include VPLs" slightly increases the frame time but improves the result accuracy.

  • Interleave Rate : Choose the interleave sampling rate, N/A (no interleaved sampling), 2x2 and 4x4.

  • shadow levels : Choose between "From S2" and "From minLevel". "minLevel" is 0 if Draw Levels is set to "Include VPLs", other wise it is 1. See section 4.1 in the paper. Choose "From minLevel" slightly increases the frame time but improves the result accuracy.

  • Shadow rate : Choose the shadow sampling rate. 1 - 1 shadow samples per pixel, 2 - 4 shadow samples per pixel.

Lighting : Sets parameters for direct lighting (sun light). You can tune these parameters if you find the sun shadow for your custom model looks incorrect.

  • Sun Inclination : Controls the sun elevation angle, a value from 0.0 to 1.0. 1.0 corresponds to vertical sunlight and 0.0 corresponds to horizontal sunlight.

  • Sun Light Intensity : Sun light intensity. Decrease this if you find the scene too bright. Alternatively, you can change the exposure to decrease the visual brightness in in Graphics>HDR>Exposure.

  • Sun Orientation : Radian of the azimuthal sun light angle.

  • Sun Shadow Center [X|Y|Z] : Sets the center location on far bounding plane of the shadowed region.

  • Sun Shadow Dim [X|Y|Z] : Sets the bounds for the orthographic projection for the directional light shadow map.

VPL : Sets parameters that controls VPL generation.

  • Density : VPL density, a value from 0.1-40.0. 0.1 corresponds to 64 VPLs, and 40.0 corresponds to about 10.5 million VPLs in the demo scene. Default is 3.9, which generates about 100000 VPLs.
    Depending on your scene and ray depth, asking more than 11 million VPLs might cause the program to crash.

  • Max Ray Depth : Light ray depth for random walk generation of VPLs (default: 3), a value from 1 to 10. Notice that this demo only considers diffuse bounces.

  • Preset Density Level : Five preset density levels are available. These density levels corresponds to about 1k, 10k, 100k, 1M, and 10M VPLs generated in the demo scene.

Graphics

The original MiniEngine post effect settings. Including FXAA and TAA, Bloom filter, depth of field, HDR, and motion blur.

Timing

VSync and frame rate limiting options.

Additional notes

  • Uncomment USELOCK macro in LigthingComputationPS.hlsl to enforce using thread locks for shadow sampling
  • Uncomment ENABLE_TEAPOT in LGHDemo.h and recompile the project to add a movable teapot in the demo scene, the teapot moving control keys can be found starting from line 291 in LGHDemo.cpp
  • Uncomment GENERATE_IR_GROUND_TRUTH in LGHDemo.h and in ScreenShaderPS.hlsl, recompile to generate instant radiosity ground truth using 1M VPLs

For questions, please email [email protected] or post an issue in the GitHub repository.

Owner
Lin Daqi
Lin Daqi
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2

Filament Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows, and WebGL. It is designed to be as small a

Google 14.3k Aug 1, 2022
Diwali Lighting using ESP32 with OTA update support

OTA_ESP32_8x50_ws2811 Diwali Lighting using ESP32 with OTA update support! This code is meant to drive 8 neopixel chains through separate pins. Being

Anindya Mitra 1 Feb 5, 2022
Desk lighting with an Arduino

desk-lighting Dimmable RGB Desk Lighting with an Arduino I made a small project for my own desktop where I used: Arduino Uno A couple of LEDs A potent

Pratham 1 Apr 9, 2022
An implementation of physically based shading & image based lighting in D3D11, D3D12, Vulkan, and OpenGL 4.

Physically Based Rendering (c) 2017 - 2018 Michał Siejak (@Nadrin) An implementation of physically based shading model & image based lighting in vario

Michał Siejak 1k Aug 8, 2022
C++ open hierarchy RTTI framework for embedded projects

Open-hierarchy custom RTTI for C++17 and up with support for multiple inheritance and dynamic casting.

Roy van Dam 13 Aug 4, 2022
Specular Lighting in OpenGL (Followed tutorial by Michael Grieco)

Specular lighting in OpenGL Specular Lighting in OpenGL (Followed tutorials by Michael Grieco). 2022-02-13.01-55-21.mp4 Setup Clone $ git clone https:

Aniket Rajnish 4 Feb 18, 2022
Bungie's Oni modified so it compiles with Microsoft Visual Studio 2019.

OniFoxed What's this? This is a modified variant of the recently leaked Oni source code so that it compiles under Microsoft Visual Studio 2019 with so

Mark Sowden 48 Jul 16, 2022
Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas.

Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas. With a theoretical transmission range of 10 miles (16kms), OTG messenger can be used by groups of people to stay connected when they are in areas not serviced by mobile connectivity.

Trevor Attema 489 Jul 13, 2022
A D++ Discord Bot template for Visual Studio 2019 (x64 and x86)

D++ Windows Bot Template A D++ Discord Bot template for Visual Studio 2019 (x64 and x86, release and debug). The result of this tutorial. This templat

brainbox.cc 19 Jul 16, 2022
Fast, hierarchical, sparse Voxel Grid

Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimens

Davide Faconti 271 Aug 6, 2022
Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimensional grid

Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimens

Davide Faconti 284 Aug 8, 2022
Fast, hierarchical, sparse Voxel Grid

Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimens

Davide Faconti 274 Aug 7, 2022
Half-Life Singleplayer SDK 2.3, updated to compile with Visual Studio 2019. Provided as-is with no further support. See the README for more information.

Half Life 1 SDK LICENSE Half Life 1 SDK Copyright© Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE

Sam Vanheer 5 Apr 9, 2022
Updates the Wii's current system time with the real world time.

Fix Wii System Time This is a homebrew tool I made for the Wii a while ago. It updates the current system time with the real world time via worldtimea

Puzzle 2 Dec 21, 2021
A recreation of the Spaceworld 1997 Ocarina of Time demo

Zelda Spaceworld ‘97 Experience This project aims to be a mostly accurate representation of the Nintendo Spaceworld 1997 demo of The Legend of Zelda:

null 181 Aug 1, 2022
Real-time 2D fluid simulator with lots of visualization options.

Fluid Simulator Building Start by cloning the program and all submodules using the following command: git clone --recursive https://github.com/linusmo

Linus Mossberg 26 Jun 20, 2022
Analytics In Real-time (AIR) is a light-weight system profiling tool

Analytics In Real-time Analytics In Real-time (AIR) is a light-weight system profiling tool that provides a set of APIs for profiling performance, lat

null 2 Mar 3, 2022
Final Assignment for Embedded Real Time Operating Systems at UCSD Extension.

Final Assignment for Embedded Real Time Operating Systems at UCSD Extension. This program is for a certificate in Embedded Software Engineering at UCSD. We used FreeRTOS running on a STM32L475G Microcontroller.

Max Guerrero 2 Jun 26, 2022
Real-time application of DIVeR

DIVeR: Real-time CUDA Application This repo contains the code for the real-time application of DIVeR implemented in Python+CUDA. Setup python 3.8 pyto

null 40 Jul 19, 2022