Correct ambient light

This commit is contained in:
BeaR 2013-04-18 17:25:53 +02:00
parent 9027e5018b
commit de7c1ef327
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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()) {