Hyperspectral Polarimetric BRDFs of Real-world Materials
The hpBRDF dataset is available on Hugging Face:
https://huggingface.co/datasets/yunseongmoon/Hyperspectral-Polarimetric-BRDF
This repository provides download_hpbrdf.py to list and download .hpbrdf material files from the dataset.
List the available material files:
python download_hpbrdf.py --listDownload one or more materials by filename or basename:
python download_hpbrdf.py --material Aluminum.hpbrdf
python download_hpbrdf.py --material "Black glass" "Red rough plastic" --output-dir dataFirst, clone the Mitsuba3 repository:
git clone -b stable --recursive https://github.com/mitsuba-renderer/mitsuba3Next, add #include <vector> near the top of mitsuba3/src/bsdfs/measured_polarized.cpp, and update the wavelength allocation (around line 158) as shown below:
pbrdf.shape[5] == 4) {
Throw("Invalid file structure: %s", tf->to_string());
}
- ScalarFloat wavelengths[5];
- for (size_t i = 0; i < 5; ++i) {
+ std::vector<ScalarFloat> wavelengths(wvls.shape[0]);
+ for (size_t i = 0; i < wvls.shape[0]; ++i) {
wavelengths[i] = ScalarFloat(((uint16_t *) wvls.data)[i]);
}
m_interpolator = Interpolator(
(ScalarFloat *) pbrdf.data,
ScalarVector2u(4, 4),Alternatively, you can copy the modified measured_polarized.cpp from this repository:
# On Linux / macOS
cp measured_polarized.cpp mitsuba3/src/bsdfs/measured_polarized.cpp
# On Windows (cmd)
copy measured_polarized.cpp mitsuba3\src\bsdfs\measured_polarized.cpp
# On Windows (PowerShell)
Copy-Item -Path measured_polarized.cpp -Destination mitsuba3\src\bsdfs\measured_polarized.cpp -ForceFinally, compile Mitsuba3 by following the official instructions.
Ensure that the _spectral_polarized variants are enabled by editing the mitsuba3/build/mitsuba.conf file. For example:
"enabled": [
"scalar_rgb", "scalar_spectral_polarized", "llvm_ad_spectral_polarized"
],