|
@@ -54,7 +54,13 @@ float calcLightAttenuation( float lightDistance, float cutoffDistance, float dec
|
|
|
|
|
|
vec3 F_Schlick( in vec3 specularColor, in float dotLH ) {
|
|
vec3 F_Schlick( in vec3 specularColor, in float dotLH ) {
|
|
|
|
|
|
- return ( 1.0 - specularColor ) * pow( 1.0 - dotLH, 5.0 ) + specularColor;
|
|
|
|
|
|
+ // Original approximation by Christophe Schlick '94
|
|
|
|
+ //;float fresnel = pow( 1.0 - dotLH, 5.0 );
|
|
|
|
+
|
|
|
|
+ // Optimized variant (presented by Epic at SIGGRAPH '13)
|
|
|
|
+ float fresnel = exp2( ( -5.55437 * dotLH - 6.98316 ) * dotLH );
|
|
|
|
+
|
|
|
|
+ return ( 1.0 - specularColor ) * fresnel + specularColor;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|