SIGN IN SIGN UP
bevyengine / bevy UNCLAIMED

A refreshingly simple data-driven game engine built in Rust

0 0 59 Rust

Improve energy conservation in the solari BRDF (#24246)

# Objective

This PR is split off from #23818.
It depends on #24313, which is integrated as the first commit here. 

There's an issue in the solari BRDF which causes partially metallic
objects to lose energy in the white furnace test.

## Solution

The current BRDF computes a blended F0 between metallic and dielectric
materials, and then uses it it for calculations. It should be evaluating
both the metallic and dielectric BRDFs separately and only blend them as
a last step.

A similar issue used to be present for IBL and was fixed in the same
way, see #23203.

## Showcase

### White furnace test

Main:
<img width="1280" height="720" alt="layering"
src="https://github.com/user-attachments/assets/5c7abaac-93ac-4a35-be76-e81681094232"
/>


This PR:
<img width="1280" height="720" alt="mixing"
src="https://github.com/user-attachments/assets/d0c32bab-c880-4222-a255-1f9a5c2e3f6a"
/>
D
Dylan Sechet committed
5aa0d22d0f592a88ba1a87f0fd08e87aae32d788
Parent: d5a0cf4
Committed by GitHub <noreply@github.com> on 5/21/2026, 3:00:10 PM