This repository provides the code of our article:
Fast and Accurate Gaussian Process Modelling of Real-World Materials Arnau Colom, Christian Bouville, Julien Pettré, Kadi Bouatouch, Ricardo Marques ACM Transactions on Graphics, 2026 DOI: 10.1145/3806194
In this paper we introduce a fast and accurate method for modelling the Bidirectional Reflectance Distribution Function (BRDF) of real-world materials. Our method relies on Bayesian regression with a Gaussian Process (GP) prior, which lets us obtain compact, purely analytical BRDF representations for all types of BRDF (isotropic or anisotropic).
In our representation we describe a material with one or two GP components: a single component captures diffuse / weakly-specular materials, while we add a second component for highly-specular materials.
We organize this repository around two parts. Evaluation and Training
It benchmarks the evaluation cost of our GP-BRDF representation and compares it against the BRDF model of Bagher et al. 2016. We share precomputed binaries of the GP model to run the code.
main.cpp loads a trained GP-BRDF model (from a .bin file) and a Bagher
material, then measures the average time needed to evaluate a BRDF value over a
dense grid of incoming/outgoing directions.
We compare four GP-BRDF evaluation strategies:
| Strategy | Description |
|---|---|
| Classic | Naive per-direction kernel evaluation (baseline). |
| Tabulated | Kernel values read from a precomputed lookup table instead of calling pow(); |
| FixedOutMultiIn | Amortizes the outgoing view kernel across a batch of incoming directions — as in a renderer that fixes the view direction and integrates over many light/sample directions. |
| MultiOutMultiIn | As above, but both the incoming and outgoing sides are batched (multiple shading points, each with its own view direction). |
For reference, we evaluate the same directions with Bagher et al.'s tabulated parametric BRDF model (Bagher et al. 2016).
The program prints, for each strategy, the mean evaluation time in microseconds,
plus a breakdown of the FixedOutMultiIn strategy into kernel-evaluation time
and matrix-multiply time.
We provide only the source and the data — no
IDE/solution files (.sln, .vcxproj, …).
What we provide:
main.cpp— the benchmark (single, self-contained source file).- GP-BRDF model binaries (
.bin) — precomputed models for several materials and support-set sizes, for example:GP_blue-fabric_Nin80.bin,GP_blue-fabric_Nin150.bin, … (diffuse / weakly specular material, one component)GP_beige-fabric_Nin*.binGP_alum-bronze_Nh*.bin(highly specular material, two components)
BagherParams.txt— the Bagher reference parameters (100 fitted materials).
Note. We hardcode the precomputed kernel lookup tables in
main.cppto the smoothness hyperparameters of the sample materials we use in our paper (e.g.s = 1.6ands = 1.2). If you use a material with different hyperparameters, you need to regenerate those tables accordingly.
- A C++ compiler with C++20 support (MSVC, GCC or Clang).
- Eigen 3.4.0 — header-only, no build step; just make its folder available to the compiler as an include directory.
- Create a project (or use a single-file compile command) in your preferred
toolchain and add
main.cppto it. - Add your local Eigen 3.4.0 folder to the include paths. For example, from
the command line:
- MSVC:
cl /std:c++20 /O2 /I path\to\eigen-3.4.0 main.cpp - GCC/Clang:
g++ -std=c++20 -O2 -I path/to/eigen-3.4.0 main.cpp -o brdf_eval
- MSVC:
- Make the data files reachable by the executable and configure the paths at
the top of
main()inmain.cpp:kBinaryDataFolder— folder containing the data files (empty means the current working directory);kGPBinaryFilename— the GP model to load (e.g.GP_blue-fabric_Nin80.bin);kBagherParamsFilename— the Bagher parameter file (BagherParams.txt);kBagherMaterialIndex— which of the 100 Bagher materials to use.
- Build with optimizations enabled (Release /
-O2) so the timings are meaningful, then run. Evaluation times (in µs) are printed to the console.
This part covers how we train our GP-BRDF representation from measured
material data (fitting the GP components, selecting the training set, and
exporting the .bin model files). We currently have a MATLAB implementation.
We will provide the (C++) training code here when we have the time to release it. Stay tuned.
If you use this code, please cite:
@article{colom2026gpbrdf,
title = {Fast and Accurate Gaussian Process Modelling of Real-World Materials},
author = {Colom, Arnau and Bouville, Christian and Pettr{\'e}, Julien and Bouatouch, Kadi and Marques, Ricardo},
journal = {ACM Transactions on Graphics},
year = {2026},
doi = {10.1145/3806194}
}