From b74cc1c42c5bfb2a0a17fc3c083a5a488c159d0d Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 15 Mar 2016 05:20:25 -0700 Subject: OpenGL2: Fix horribly broken metallic shader. --- src/renderergl2/glsl/lightall_fp.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/renderergl2/glsl') diff --git a/src/renderergl2/glsl/lightall_fp.glsl b/src/renderergl2/glsl/lightall_fp.glsl index f16298a3..64cae3fa 100644 --- a/src/renderergl2/glsl/lightall_fp.glsl +++ b/src/renderergl2/glsl/lightall_fp.glsl @@ -333,8 +333,9 @@ void main() // specular red is gloss // specular green is metallicness float gloss = specular.r; - specular.rgb = specular.g * diffuse.rgb + vec3(0.04 - 0.04 * specular.g); - diffuse.rgb *= 1.0 - specular.g; + float metal = specular.g; + specular.rgb = metal * diffuse.rgb + vec3(0.04 - 0.04 * metal); + diffuse.rgb *= 1.0 - metal; #else // diffuse rgb is diffuse // specular rgb is specular reflectance at normal incidence -- cgit