![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <QtGlobal>#include <algorithm>#include <cmath>Go to the source code of this file.
Classes | |
| struct | OpenSWMM::Render::ScalarRampLut |
Namespaces | |
| namespace | OpenSWMM |
| namespace | OpenSWMM::Render |
QSG-2D-1M Phase 8 — pure scalar→ramp-index math for GPU color mapping.
The shader fill path uploads raw per-vertex scalars plus a small 1-D ramp texture (LUT); the GPU normalizes the scalar and samples the LUT. This header holds the pure normalization/clamp contract shared by the CPU LUT baker and the shader (which mirrors it in GLSL):
t = clamp((value - vMin) / (vMax - vMin), 0, 1)
Degenerate ranges (vMax <= vMin) and non-finite values clamp to 0 so a bad frame can never index out of the LUT. Unit-tested headlessly in tests/unit/test_scalarramplut.cpp; the texture itself is verified visually (shader output is not meaningfully unit-testable).