Skip to content
 
 

Repository files navigation

Note — this fork adds a WebAssembly target for the Radiance command-line tools.

Upstream's sources are already Emscripten-clean; it is the build system that is not. Two if(EMSCRIPTEN) guards fix that, and with them an emcmake configure succeeds tree-wide (the X11 and TIFF targets sit behind if(X11_FOUND) / if(TIFF_FOUND) and drop out on their own):

  • src/CMakeLists.txt raised FATAL_ERROR when find_library(LIB_M m) found nothing. Emscripten sets UNIX but folds libm into libc, so there is nothing to find and the math symbols resolve anyway.
  • add_compile_options(-mavx2 -mfma) is applied globally to every non-Apple UNIX build. Emscripten lands there and emcc rejects x86 SIMD flags without -msimd128. (src/util/CMakeLists.txt does this correctly, gating on check_c_compiler_flag and scoping the flags to mmavx2.c; the root applies them unconditionally and never consults that check.)

Everything else is additive. Seven tools currently build — evalglare, getinfo, pcomb, pcompos, pfilt, psign, ra_xyze — listed in RADIANCE_WASM_TOOLS. Adding another is one entry there; the target already exists upstream.

# node build: real filesystem via NODERAWFS, same argv and paths as native
emcmake cmake -S . -B build-wasm -DBUILD_HEADLESS=ON -DBUILD_QT=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build-wasm --target evalglare getinfo pcomb pcompos pfilt psign ra_xyze -j8

# browser build: ES modules, virtual filesystem, FS and callMain exported
emcmake cmake -S . -B build-web ... -DRADIANCE_WASM_NODERAWFS=OFF

The wasm output matches native exactly. The full HDRICalibrationTool pipeline was run over both reference brackets (5616x3744 JPEG, 5796x3870 CR2), and against a native build with -ffp-contract=off every stage is byte-identical, including evalglare's reported vertical illuminance. The only difference from a stock native build (~0.005% of channels, unbiased) is arm64 FMA contraction, confirmed by control.

This fork exists to serve radiantlab/HDRICalibrationTool#229, which ports that app's pipeline off locally-installed binaries so it can run fully client-side. See FORK.md for the measurements, the upstream sync checklist, and the psign font handling.

Single branch: main. Upstream's own README is README.txt.

Radiance

A validated lighting simulation and rendering system, developed at Lawrence Berkeley National Laboratory. See README.txt for upstream's introduction, INSTALL.scons for the standard build, and radiance-online.org for documentation.

Upstream: LBNL-ETA/Radiance.

About

A Validated Lighting Simulation Tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages