Bevy Daily 2026-05-16: Solari BRDF Layering Improvement (PR #24243)

Source

  • PR: Improve layering in the solari BRDF
  • Author: dylansechet
  • Merged: 2026-05-15
  • Reviewers: JMS55, SparkyPotato (31 review comments)
  • Split from: #23818
  • Related PR: #24246 (energy conservation further improvement, still open)

Executive Summary

PR #24243 fixes the Solari path tracer’s BRDF energy conservation defect where the specular and diffuse lobes were incorrectly allocating energy, causing energy loss visible in white furnace tests. The fix adopts an OpenPBR-inspired layering model (equation 42, glossy-diffuse base substrate) with Filament’s multiscattering correction instead of OpenPBR’s EON method. A key tradeoff: the new formulation breaks reciprocity (bidirectional reflectance distribution symmetry), but this is acceptable for Bevy’s unidirectional path tracer.

Key Findings

1. Energy Conservation Defect (critical)

The old Solari BRDF layering code had a fundamental flaw: the energy distribution between specular and diffuse lobes was incorrect. In a white furnace test (uniform white environment), the material should reflect exactly the incident energy. The old code showed visible energy loss, indicating the specular/diffuse energy partitioning was wrong.

2. Fix: OpenPBR Equation 42 + Filament Multiscattering (critical)

The fix references OpenPBR equation 42 — the glossy-diffuse base substrate model — for correct layering of the specular lobe over the diffuse lobe. However, instead of using OpenPBR’s EON (Energy-preserving Oren-Nayar) method, the author chose Filament’s multiscattering correction approach. The Filament model is simpler to implement and well-validated in production.

3. Reciprocity Tradeoff (important)

The new formula breaks reciprocity — the property that swapping light and camera directions yields the same result (BRDF is symmetric). For a unidirectional path tracer like Solari, reciprocity is not required for correctness. The author argues this is a pragmatic choice: energy conservation matters more for visual quality than mathematical reciprocity in this context.

4. Ancillary Fixes (contextual)

  • Mirror roughness threshold: Fixed BRDF evaluation logic for mirror-like surfaces, correct PDF computation.
  • Performance: Hoisted F_AB texture sampling to avoid redundant lookups across lobes — a direct micro-optimization.

5. Modified Files (important)

  • crates/bevy_solari/src/scene/brdf.wgsl — BRDF layering math rewrite
  • crates/bevy_solari/src/pathtracer/pathtracer.wgsl — caller-side adjustments

Technical Depth

White Furnace Test

A white furnace test renders a scene where every surface is uniformly lit from all directions (constant radiance). An energy-conserving BRDF must reflect exactly the same energy it receives — the rendered result should be uniformly white. Energy loss manifests as dimming; energy gain manifests as brightening. This test is the gold standard for BRDF correctness.

OpenPBR Equation 42: Glossy-Diffuse Base Substrate

OpenPBR defines a layered material model where a specular (glossy) layer sits on top of a diffuse base. Equation 42 describes the correct energy split: the specular lobe’s Fresnel term determines how much energy reflects at the top layer, and the remaining energy passes through to the diffuse layer below. The old Solari code did not correctly account for this energy partitioning.

Filament Multiscattering vs OpenPBR EON

Both approaches handle the same problem: multiple bounces within the specular microsurface layer. OpenPBR’s EON method is more physically accurate but computationally heavier. Filament’s multiscattering correction is a faster approximation that produces visually similar results. The author chose Filament’s approach for its balance of accuracy and performance.

Reciprocity in Unidirectional Path Tracing

Physical BRDFs are reciprocal: f(ωi → ωo) = f(ωo → ωi). This property is essential for bidirectional path tracing (BDPT) where light paths are constructed from both camera and light sources. However, for unidirectional path tracing (camera → scene → light), reciprocity is not required — the renderer only evaluates the BRDF in one direction. Breaking reciprocity is a valid optimization for unidirectional tracers.

Impact Assessment

  • For users of Bevy’s path tracer: Direct visual improvement — materials now correctly conserve energy, especially noticeable on rough metallic surfaces and layered material setups.
  • For developers using custom BRDFs: The reciprocity tradeoff is worth noting if you plan to extend Solari to bidirectional path tracing in the future.
  • Migration: No user-facing API changes. The fix is entirely internal to the Solari path tracer’s shader code.

Cross-References

  • Wiki: bevy-rendering — broader rendering system context
  • Wiki: bevy-game-dev-2026-05 — May 2026 engine changes tracking
  • Related raw: bevy-daily-2026-04-25-solari-brdf-local-tbn.md (PR #23948, TBN/seams fix from same parent PR #23818)
  • Related open PR: #24246 (further energy conservation improvements)