Awesome
Illumination-driven Light Probe Placement
Overview
This repository contains the source code of a prototype implementation of the Eurographics 2021 Poster: Illumination-driven Light Probe Placement, in the form of a Unity component. Some test scenes are also included. However, the source code can be simply added and used in a Unity project without the additional content in this repository.
Some helpful/quick links are:
- Author version of the paper
- YouTube short video presentation (3 min)
- Direct link to the unitypackage, to directly import to your project
- Direct link to the source code of the Unity component: Scripts and Editor
- The important parts are located in the DecimateLightProbes function in the LumiProbesScript.cs file.
Key Features:
- Light Probe/Evaluation Point Placement Types: Grid (good for Light Probes), Stratified, Random, Poisson (good for Evaluation Points)
- Stopping Conditions: Minimum Probes and Maximum Error
- Two illumination-based simplification options:
- Luminance, for scenes with similar light colours, i.e. to retain a higher probe density at regions with high luminance transitions
- Chrominance, for scenes with contrasting light colours, i.e. to retain a higher probe density at regions with high chrominance variations
Table of Contents
- Algorithm Overview
- Unity Component Instructions
- How to Cite
- Notes-Limitations
- Acknowledgments
- References
Algorithm Overview
This work proposes a light probe simplification method that preserves the indirect illumination distribution in scenes with diverse lighting conditions. This is accomplished through an iterative graph simplification algorithm that discards probes, according to a set of evaluation points, that have the least impact on the global light field.
Briefly, the algorithm consists of two stages: Setup, to generate the reference light probe configuration, and Simplification, to perform the graph decimation.
Setup steps:
- Generate a (dense) set of light probes (LP)
- Compute the LPs radiance field (e.g. SH coefficients) and store them in a graph
- Generate a set of evaluation points (EP)
- Compute the EPs incident energy by sampling a set of directions around each EP. The incoming energy for each direction is determined by interpolating the k-nearest LPs from the graph. Store either the result of each direction separately, or the average over all directions (approximate result, but less sensitive to outliers)
- Store the EP incident energy as a reference
Simplification steps:
- While the requested minimum LP set and/or maximum error is not reached:
- Iterate over all LPs
- Select a candidate LP to remove and compute a new temp graph (with n-1 LPs)
- Compute the new radiance field for the EPs, as in 1iv
- Compute the error with the reference field as:
- Convert the RGB values to Luminance-Chrominance, like YCoCg [MS03]
- Compare the YCoCg components using different weights to preserve different illumination characteristics (e.g. Y=1,Co,Cg=0 for Luminance-driven and Y=0.1,Co,Cg=0.45 for Chrominance-driven simplification)
- Compute the final cost based on absolute percentage errors, e.g. SMAPE, or others
- Keep this graph configuration if it has the minimum error and go to a
- Replace graph with the n-1 LP graph with the minimum error
- Iterate over all LPs
Unity Component Instructions
To Import
- Add a Light Probe Group object to your scene
- Import the contents source code of the Unity component and add the LumiProbes script in the Light Probe Group
To Run
- The component is configured in two panels: the Placement panel (left), which places the LPs and EPs, and the Settings Panel (right), which configures optimisation parameters:
- Once these are set, click Bake Light Probes (Async) and Run Optimiser (right):
The entire process is also illustrated for a test scene below:
All messages are logged in the log file: LumiProbes_log.txt.
How to Cite
The license is MIT. If you use the contents of this repository for your work, please cite it as described below:
LaTeX and BibTeX example usage
<blockquote> <pre style="white-space:pre-wrap;"> In our work, we have used the source code~\cite{Vardis_2021_EG_2021_Poster}, available at <em>'https://github.com/cgaueb/light_probe_placement'</em>. </pre> <pre style="white-space:pre-wrap;"> @article{Vardis_2021_EG_2021_Poster, booktitle = {Eurographics 2021 - Posters}, editor = {Bittner, Jirí and Waldner, Manuela}, title = {{Illumination-driven Light Probe Placement}}, author = {Vardis, Konstantinos and Vasilakis, Andreas Alexandros and Papaioannou, Georgios}, year = {2021}, publisher = {The Eurographics Association}, ISSN = {1017-4656}, ISBN = {978-3-03868-134-2}, DOI = {10.2312/egp.20211026} } </pre> </blockquote>Notes-Limitations
- This is a preliminary version of this research work
- High-processing times are currently observed for high EP-LP counts. Various pipeline stages allow for useful optimisations, e.g. by exploiting spatial locality during the generation of the new graphs.
- With respect to the component implementation, some parts could be more conformant with Unity's implementation guidelines for productions purposes.
- The component has been tested with Unity version 2021.1.4f1
Any advice/additions are welcome!
Acknowledgments
This research is co-financed by Greece and the European Union (European Social Fund) through the Operational Programme "Human Resources Development, Education and Lifelong Learning 2014-2020" for the project "Modular Light Transport for Photorealistic Rendering on Low-power Graphics Processors" (5049904).
The Office, Block15 and TestProbes scenes in this repository have been created by the CG AUEB Group. The Sponza model was obtained from Morgan McGuire’s Computer Graphics Archive. The Ethan character and all other scripts are part or have been modified from the Unity's Standard Assets.
The C# Poisson implementation for the LP/EP placement is based on Bart Wronski's implementation that you can find here.
References
- <a name="[MS03]">[MS03]</a>Malver H., Sullivan G.: YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range. Tech. Rep. JVTI014r3. 21, Joint Video Team (JVT) of ISO/IEC MPEG & ITU-T VCEG, July 2003.