提交 72e3b59e 编写于 作者: T tschw

Optimized Fresnel (see Epic talk at SIGGRAPH '13).

上级 20a81f16
......@@ -54,7 +54,13 @@ float calcLightAttenuation( float lightDistance, float cutoffDistance, float dec
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册