Light source color is now mixed with material specular if material is non-metal, not mixed if metal. Looks like we can deprecate IOR this way.

This commit is contained in:
AnotherCommander 2018-08-26 20:33:33 +02:00
parent 4287a8e827
commit b526cff5fd

View File

@ -392,7 +392,8 @@ void main(void)
totalColor += (ambientColor * ambientLight + diffuseColor * diffuseLight) * kD;
#if OOSTD_SPECULAR
totalColor += mix(specularColor, gl_LightSource[1].specular, f0) * specularLight;
vec3 magSpec = specularColor.rgb;
totalColor += mix(specularColor, gl_LightSource[1].specular, 1.0 - clamp(length(magSpec), 0.0, 1.0)) * specularLight;
#endif