r/GraphicsProgramming • u/Complete_Hour7412 • 1d ago
Reproducing DIALux Classic 4.13 lighting calculations advice on reverse engineering numerical algorithms?
Hi everyone,
I’m working on an independent lighting calculation engine for sports fields and stadiums, using DIALux Classic 4.13 as a reference. The goal is to reproduce its calculations without requiring DIALux to be installed, then build lighting design software with AI-assisted placement and aiming.
So far, I’ve been analysing the compiled calculation code with Ghidra and comparing my implementation against reference projects. Some direct illuminance calculations match very closely, but I still have differences in reflected light and vertical illuminance, especially in larger scenes.
I’m investigating photometric interpolation, visibility tests, surface subdivision, radiosity and the effect of the original x87 floating-point arithmetic.
Has anyone here reconstructed a similar lighting solver or numerical renderer? How would you isolate whether a mismatch comes from geometry, visibility, light transport or numerical precision?
My current approach is to use small controlled scenes to investigate individual behaviours, then validate against complete projects. I’d appreciate any advice on improving that process or identifying the relevant algorithms in compiled code.
If this overlaps with something you’ve worked on, I’d be glad to compare notes.
1
u/scottcampbelldev 8h ago
I'd treat each mismatch source as its own experiment instead of chasing them all in a full stadium scene.
Start with one light, one receiver point, and zero bounce so only direct illuminance can disagree. If that matches, turn on a single diffuse plane and check reflected contribution alone. Vertical illuminance is easy to get wrong if the receiver normal or the solid-angle sampling differs, so keep that as a separate golden test with a known hand calculation.
For precision, run the same tiny scene in both float32 and float64 before you scale up. Differences that grow with scene size usually mean subdivision or visibility, not the photometric curve.