Permalink
Browse files

OpenGL2: Fix horribly broken metallic shader.

  • Loading branch information...
SmileTheory authored and timangus committed Mar 15, 2016
1 parent beefb51 commit b74cc1c42c5bfb2a0a17fc3c083a5a488c159d0d
Showing with 3 additions and 2 deletions.
  1. +3 −2 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

0 comments on commit b74cc1c

Please sign in to comment.