mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 14:32:55 +00:00
OpenGL2: Fix horribly broken metallic shader.
This commit is contained in:
parent
eb7408ddac
commit
f911e32bb0
1 changed files with 3 additions and 2 deletions
|
@ -333,8 +333,9 @@ void main()
|
||||||
// specular red is gloss
|
// specular red is gloss
|
||||||
// specular green is metallicness
|
// specular green is metallicness
|
||||||
float gloss = specular.r;
|
float gloss = specular.r;
|
||||||
specular.rgb = specular.g * diffuse.rgb + vec3(0.04 - 0.04 * specular.g);
|
float metal = specular.g;
|
||||||
diffuse.rgb *= 1.0 - specular.g;
|
specular.rgb = metal * diffuse.rgb + vec3(0.04 - 0.04 * metal);
|
||||||
|
diffuse.rgb *= 1.0 - metal;
|
||||||
#else
|
#else
|
||||||
// diffuse rgb is diffuse
|
// diffuse rgb is diffuse
|
||||||
// specular rgb is specular reflectance at normal incidence
|
// specular rgb is specular reflectance at normal incidence
|
||||||
|
|
Loading…
Reference in a new issue