Skip to content

Commit a9e8c55

Browse files
authored
The fresnel can't hurt you any more (#22454)
<img width="1224" height="792" alt="image" src="https://github.com/user-attachments/assets/59e60ee4-e7ed-4a7b-8583-e0643dffac98" /> <img width="1224" height="792" alt="image" src="https://github.com/user-attachments/assets/ee85f225-9f80-4c23-81bb-210b87dfcf32" />
1 parent 61dab10 commit a9e8c55

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

crates/bevy_pbr/src/light_probe/environment_map.wgsl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,10 @@ fn environment_map_light(
238238
let specular_occlusion = saturate(dot(F0, vec3(50.0 * 0.33)));
239239

240240
// Multiscattering approximation: https://www.jcgt.org/published/0008/01/03/paper.pdf
241-
// Useful reference: https://bruop.github.io/ibl
242-
let Fr = max(vec3(1.0 - roughness), F0) - F0;
243-
let kS = F0 + Fr * pow(1.0 - NdotV, 5.0);
241+
// We initially used this (https://bruop.github.io/ibl) reference with Roughness Dependent
242+
// Fresnel, but it made fresnel very bright so we reverted to the "typical" fresnel term.
244243
let Ess = F_ab.x + F_ab.y;
245-
let FssEss = kS * Ess * specular_occlusion;
244+
let FssEss = (F0 * Ess) * specular_occlusion;
246245
let Ems = 1.0 - Ess;
247246
let Favg = F0 + (1.0 - F0) / 21.0;
248247
let Fms = FssEss * Favg / (1.0 - Ems * Favg);

0 commit comments

Comments
 (0)