Fresnel approximation: I have two different implementations, which one is "correct"?

Consolidating various partially-redundant shader includes and noticed I used 2 different fresnel implementations:

First one from some PBS tutorials, can’t remember which:

const half fresTerm = pow(1.0 - dotHL, 5.0) * (1.0 - f0) + f0;

Second one from J. Hable:

const half expo = pow(1.0 - dotHL, 5.0);
const half fresTerm = expo + f0 * (1.0 - expo);

For specular, both look “fine” to the physically-based-untrained-eye and even to mine. I can’t tell visually which one is correct. But clearly both functions clearly give slightly different result floats as they do plain different things from their inputs.

what is wrong or right depends on your eye pleasure here, forexample i have 5 different fresnel calculations in my water shaders package for every case.

Yeah but I do everything reflective in a single deferred light pass so per-material fresnel is out :smile:

I found another one by Lagarde:

const half expo = pow(1.0 - dotHL, 5.0);
const half fresTerm = f0 + (1.0f - f0) * expo

Seems like there is no end to Fresnel approximations :smile:

I’ve always used Schlick’s approximation which is something like-

 fresnel = exponential + _Fresnel * (1.0 – exponential);

where exponential is: pow( 1 – dot(V,H), 5.0);

So what? Just pick the fastest one with the better visual.

Guess I could “try” that :smile: :smile:

It seems to me that both are pretty much the same. Just a different ordering of the variables with the same result.

a + (1 - a) * b = b + a * (1 - b)