From de7c1ef32756c227cad176f4f1b84fc5db0fd27b Mon Sep 17 00:00:00 2001 From: BeaR Date: Thu, 18 Apr 2013 17:25:53 +0200 Subject: [PATCH] Correct ambient light --- GPU/GLES/TransformPipeline.cpp | 2 +- GPU/GLES/VertexShaderGenerator.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index b8f5f7009c..6cd715955f 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -348,7 +348,7 @@ void Lighter::Light(float colorOut0[4], float colorOut1[4], const float colorIn[ if (gstate.lightEnable[l] & 1) { Color4 lightAmbient(gstate_c.lightColor[0][l], 0.0f); - lightSum0 += (lightAmbient + diff) * lightScale; + lightSum0 += (lightAmbient * *ambient + diff) * lightScale; } } diff --git a/GPU/GLES/VertexShaderGenerator.cpp b/GPU/GLES/VertexShaderGenerator.cpp index dea27ffacb..41cdb92d54 100644 --- a/GPU/GLES/VertexShaderGenerator.cpp +++ b/GPU/GLES/VertexShaderGenerator.cpp @@ -381,7 +381,7 @@ void GenerateVertexShader(int prim, char *buffer) { WRITE(p, " if (dot%i > 0.0)\n", i); WRITE(p, " lightSum1 += u_lightspecular%i * %s * (pow(dot%i, u_matspecular.a) * lightScale%i);\n", i, specular, i, i); } - WRITE(p, " lightSum0 += vec4((u_lightambient%i + diffuse%i)*lightScale%i, 0.0);\n", i, i, i); + WRITE(p, " lightSum0 += vec4((u_lightambient%i * %s + diffuse%i)*lightScale%i, 0.0);\n", i, ambient, i, i); } if (gstate.isLightingEnabled()) {