Sampling Clear Sky Models using Truncated Gaussian Mixtures
This repository contains the source code that is part of the supplemental material for the EGSR 2021 Paper: Sampling Clear Sky Models using Truncated Gaussian Mixtures. The contents are:
Some additional quick links
The folders are:
To build the sky maps tool:
Dependencies Folder
Run the following command for MSVC:
cl /O2 /MT /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" SunSky.cpp SunSkyTool.cpp /I "include" /link /LIBPATH:"lib/x64" "FreeImage.lib"
or
This generates the executable ‘SunSky.exe’
* clang++.exe -O2 SunSky.cpp SunSkyTool.cpp -Iinclude -L"lib/x64" -o SunSky.exe -lFreeImage
To generate sky maps and dataset, Go to cpp_sky_gen_code folder and run:
SunSky.exe -s Hosek -p (for Hosek)
SunSky.exe -s Preetham -p (for Preetham)
To run the scripts that generate the dataset and perform the fitting process, go to the python_fitting_code\skymodel folder and run main.py.
The provided functionality for the script is:
python main.py -h
usage: main.py [-h]
[--generateDataset input directory output_directory]
[--best_num_gaussians min_value max_value]
[--fit]
[--plot]
[--visualize_model model name max_GMMs_to_show]
[--skymapdir skymap directory]
[--outdir output directory]
optional arguments:
-h, --help show this help message and exit
--generateDataset input directory output_directory, -g input directory output_directory
Generates the dataset for the fitting process.
--best_num_gaussians min_value max_value, -b min_value max_value
Performs fitting and stores the best GMM count.
Expects min max arguments.
--fit, -f Fits the .tiff skymap files in the skymap dir
--plot, -p Plots the result during fitting
--visualize_model model name max_GMMs_to_show, -v model name max_GMMs_to_show
Visualises up to 'max_GMMs' from the model
--skymapdir skymap directory, -s skymap directory
Sky Model PDF directory. Default is
../../dataset/hosek/hosek_sky_luminance
--outdir output directory, -o output directory
Output directory. Default is fit
For example, to generate luminance sky maps:
python main.py --generateDataset ..\..\dataset\hosek\hosek_sky ..\..\dataset\hosek\hosek_sky_luminance
Additionally, to run the fitting process (output at fit\model.csv):
python main.py --fit --skymapdir ..\..\dataset\hosek\hosek_sky_luminance --outdir fit
Simply replace the files in the pbrt source code directory. The important files are:
The license is Apache 2.0. If you use the contents of this repository for your work, please cite it as described below:
In our work, we have used the source code~\cite{Vitsas_EGSR_2021}, available at ‘https://github.com/cgaueb/tgmm_sky_sampling‘.
@inproceedings{vitsas2021tgmm,
booktitle = {Eurographics Symposium on Rendering - DL-only Track},
editor = {Bousseau, Adrien and McGuire, Morgan},
title = {{Sampling Clear Sky Models using Truncated Gaussian Mixtures}},
author = {Vitsas, Nick and Vardis, Konstantinos and Papaioannou, Georgios},
year = {2021},
publisher = {The Eurographics Association},
ISSN = {1727-3463},
ISBN = {978-3-03868-157-1},
DOI = {10.2312/sr.20211288}
}
Note: A proper bibtex will be uploaded when the paper gets published.
The provided sky map generation utility is based on a modified version of the excellent library by Andrew Willmott available here.
The breakfast room scene was downloaded from Benedikt Bitterli’s rendering resources. All remaining scenes were
obtained from the PBRT-v3 scene repository.