Skip to content

Markvanderuit/metameric_dev

Repository files navigation

Controlled Spectral Uplifting for Indirect-Light Metamerism

teaser_1

This repository contains the source code of our spectral uplifting editor Metameric, which accompanies our recent paper "Controlled Spectral Uplifting for Indirect-Light-Metamerism" (paper, author, proceedings), presented at Siggraph Asia 2024.

With this demo editor, we show how artist-controllable spectral uplifting might be a great addition to the artist toolbox. Our method allows us to use (and misuse) spectral metamerism. In a spectral renderer with color-to-spectral uplifting, the color behavior of scene objects is dependent on an extremely underdetermined uplifting process. We use this to change the uplifted appearance of objects under complex indirect illumination, while keeping input colors intact. We include several example scenes with different spectral behaviors, and provide windows/linux builds (that might even work sometimes!) on the releases page.

For full details on how our method works, check out the paper, and feel free to contact one of the authors (Mark van de Ruit, Elmar Eisemann) if you have questions.

teaser_2

Compilation

To build the project, you'll need a recent C++23 compiler (e.g. MSVC 17.12 or GCC 13), and OpenGL 4.6 and CMake 3.22+. Dependencies are bundled through VCPKG, submodules, and packed binaries.

As a first step, clone the repository and any submodules.

  git clone --recurse-submodules https://github.com/markvanderuit/metameric_dev

Next, simply configure and compile the project using CMake:

  cmake -S metameric_dev -B build
  cmake --build build --config Release --target metameric_editor

If compilation succeeds without any errors, you should find an executable at build/bin/metameric_editor.

Note Some Unix systems may require X11/Wayland development packages for certain dependencies. VCPKG provides information on what you should install using your own package manager. E.g. for GLFW, the GLFW compilation page lists a number of required packages.

Spectral editing

When you first run the editor (and all shaders compiled succesfully), you are greeted by an example scene: a simple cornell box. The editor has three main parts you can interact with.

  1. Scene components (left). Objects, emitters and views can be placed and tweaked. The only important bit is the list of upliftings; each scene object must have an associated uplifting, which translates the object's RGB albedo together with spectral constraints into spectral reflectance data. You can see that the default uplifting in this scene has a single constraint already. Click the edit button to edit this constraint's behavior.
  2. The viewport (right). Use middle mouse to pan, right mouse to rotate, and the mouse wheel to zoom your camera and move around the scene. Use left mouse to interact with spectral constraints on scene positions, if any are visible. If you clicked edit earlier, a single spectral constraint should now be marked as a blue dot in the cornell box' red shadow.
  3. The mismatch editor (floating). When you clicked edit, this window popped up. Here, you see (top) the generated spectral reflectance at that blue marker position. Below that (middle) are input and constraint colors imposed on the underlying scene data. You can use the editor (bottom) to tweak the bottom-most constraint color. This is the color that spectral uplifting should produce at that blue scene marker. Simply pick and drag the point in the mismatch volume to edit the cornell box' shadow color.

til

Other editor features

If you play around with the editor a bit, there are some minor features that are useful:

  • Use View > Render to file to render a scene view to a .exr file.
  • Use View > Path measure tool to turn your mouse into a spectrometer. You can see the spectral radiance going through your mouse into the camera. In addition, the renderer visualizes the light paths used to build this radiance estimate. The same path measures are used to build indirect light constraints.
  • Use File > Import > Mesh/Image to import a .obj scene and texture data. The OBJ importer is rather incomplete, and it may ignore some of your scene data.

Citation

If you found any of this useful in your research, please cite the following paper:

@InProceedings { RE24,
  author       = "van de Ruit, Mark and Eisemann, Elmar",
  title        = "Controlled Spectral Uplifting for Indirect-Light-Metamerism",
  booktitle    = "SIGGRAPH Asia 2024 Conference Papers",
  year         = "2024",
  publisher    = "ACM",
  doi          = "https://doi.org/10.1145/3680528.3687698",
  url          = "http://graphics.tudelft.nl/Publications-new/2024/RE24"
}

License and third party software

The software in this repository is released under an open source license, designed for you to use the software in open source or academic environments. If you are interested in obtaining the software under a private commercial license, contact the Delft University of Technology for options.

All third-party software packages used in this repository are governed by their respective licenses. Without the following excellent libraries, this project would not exist: AutoDiff, Dear ImGui, Eigen, fmt, GLAD, GLFW, GLM, Glslang, ImGuizmo, ImPlot, Intel Embree, JSON for Modern C++, MeshOptimizer, NLOpt. Qhull, RapidOBJ, SPIRV-Cross, SPIRV-Tools, stb, TinyEXR, TinyFileDialogs, TBB, Tracy, Vcpkg, zlib, zstr