• Create Account

### #ActualYours3!f

Posted 21 May 2012 - 02:45 AM

here's the relevant wiki article:
http://en.wikipedia....s_approximation
here's Schlick's original paper from 1994:
http://www.ics.uci.e...s/Schlick94.pdf
and if you're successful with implementing the Schlick method, then you may proceed to more advanced approximations:
http://en.wikipedia....esnel_equations

so for you I think the fresnel term should be:

//Fresnel approximation
float base = 1-dot(f_viewDirection, halfWay);
float exp = pow(base, 5);
float fresnel = fZero + (1 - fZero)*exp;


I've taken a look at the first article (as well as several others that mentioned it). Haven't checked the original paper yet though. Anyhow, the code you wrote is exactly the same as the one I posted, it's just that the one I've posted is re-written. Both of them give: f0 + exp - f0*exp

oh, ok, then you just need to find out how to use the fresnel term, because then you calculated it right...
outputColor.rgb =  ambientReflection + diffuseReflection + specularReflection + fresnel;


### #1Yours3!f

Posted 21 May 2012 - 02:34 AM

here's the relevant wiki article:
http://en.wikipedia....s_approximation
here's Schlick's original paper from 1994:
http://www.ics.uci.e...s/Schlick94.pdf
and if you're successful with implementing the Schlick method, then you may proceed to more advanced approximations:
http://en.wikipedia....esnel_equations

so for you I think the fresnel term should be:

//Fresnel approximation
float base = 1-dot(f_viewDirection, halfWay);
float exp = pow(base, 5);
float fresnel = fZero + (1 - fZero)*exp;


I've taken a look at the first article (as well as several others that mentioned it). Haven't checked the original paper yet though. Anyhow, the code you wrote is exactly the same as the one I posted, it's just that the one I've posted is re-written. Both of them give: f0 + exp - f0*exp

oh, ok, then you just need to find out how to use the fresnel term, because then you calculated it right...

PARTNERS