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 anemcmakeconfigure succeeds tree-wide (the X11 and TIFF targets sit behindif(X11_FOUND)/if(TIFF_FOUND)and drop out on their own):
src/CMakeLists.txtraisedFATAL_ERRORwhenfind_library(LIB_M m)found nothing. Emscripten setsUNIXbut 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.txtdoes this correctly, gating oncheck_c_compiler_flagand scoping the flags tommavx2.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 inRADIANCE_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=OFFThe 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=offevery stage is byte-identical, includingevalglare'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.mdfor the measurements, the upstream sync checklist, and thepsignfont handling.Single branch:
main. Upstream's own README isREADME.txt.
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.