# Feat: Groundbreaking denoiser — SG-based physical irradiance integration + SVGF with Mahalanobis edge-stopping
This is a landmark release that rewrites the entire denoising pipeline from the
ground up. The new denoiser produces dramatically cleaner, more stable, and
more physically accurate results than ALL previous versions combined.
## CORE INNOVATION: Spherical Gaussian (SG) Physical Irradiance Integration
The old SH (Spherical Harmonics) irradiance projection has been completely
replaced with a physically-based SG (Spherical Gaussian) integration framework:
• Dual-SG product convolution — light lobe × cosine lobe solved analytically
via SGProduct(), yielding exact attenuation without series truncation
• HSG (Hemispherical Spherical Gaussian) integral — closed-form integration
over the hemisphere using a rational approximation of the erf function
• NaN-safe math primitives throughout — precise_erf() with Abramowitz-Stegun
coefficients, expm1_over_x() with 1st-order Taylor fallback, and
safe_lambda_over_one_minus_exp_two_lambda() with cubic Taylor expansion
near the singular point λ → 0
• Numerically stable dual-SG product — sqrt_term clamped against negative
floating-point drift, axis normalization with ε-guard, log-space amplitude
accumulation to avoid overflow
This means every irradiance sample is now projected and reconstructed with
physically correct cosine-weighted integration, eliminating the ringing,
energy loss, and directional smearing that plagued the old SH pipeline.
## TEMPORAL ACCUMULATION: Unbiased Welford Variance Estimation
Previous versions used a biased exponential moving variance. The new pipeline
employs Welford's online algorithm — a numerically stable, UNBIASED estimator
that tracks both mean and variance in a single pass:
• True population variance (not EMA approximation) → spatial filter gets
accurate uncertainty estimates
• Per-pixel temporal weight based on geometric consistency (normal × depth
× position reprojection validation)
• Exponential moving average blending with adaptive history length —
faster convergence on new surfaces, longer accumulation on static ones
## SPATIAL FILTER: SVGF with Mahalanobis-Distance Edge-Stopping
The à-trous wavelet filter has been completely rewritten with a multi-
dimensional edge-stopping function that jointly considers:
• Normal similarity: pow(dot(n1, n2), NORMAL_POWER) — cosine-weighted
• Depth discontinuity: anisotropic kernel stretching along surfaces at
grazing angles, staying tight across depth edges
• Luminance-directional statistical distance: full Mahalanobis distance
combining SH-derived intrinsic variance (|dir|² vs Y²) with temporal
Monte Carlo variance → variance-guided adaptive stopping
6-level à-trous hierarchy: step 1→2→4→8→16→32 pixels, each with R0
tuned to the spatial scale. High-variance regions get aggressive filtering;
well-converged regions preserve fine detail. This is a night-and-day
difference from the old uniform blur.
## ADDITIONAL IMPROVEMENTS
• Neural network tone mapper (20 hidden neurons, 4→20→3 architecture with
sigmoid activations) — trained to approximate a high-quality photographic
tone curve, replacing the old hard-coded filmic curve
• Full HDR pipeline (hdr.glsl) — proper HDR→SDR conversion with luminance
adaptation
• Physically-based atmosphere scattering rewrite — Rayleigh/Mie with per-
dimension parameters (Overworld/Nether/End), sunlight brightness boosted
10× to match real-world solar irradiance ratios
• Importance sampling via Gaussian sphere function — faster convergence
with fewer fireflies
• Parallax Occlusion Mapping — geometric detail on flat surfaces
• GGX denominator epsilon guards — prevents NaN/Inf propagation in
specular BRDF evaluation
• Fixed a serious TAA reprojection bug, reduced VRAM usage
• Comprehensive technical documentation (main.pdf / main_en.pdf) covering
the full pipeline with mathematical derivations
---
RESULT: This is not an incremental improvement. The denoising quality jump
is categorical — clean indirect illumination that converges faster, preserves
geometric detail, and eliminates the noise bias that plagued every prior
version. The renderer is now fundamentally physically-grounded rather than
heuristic.
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }