Merge pull request #2088 from unknownbrackets/gpu-lighting

Multiply by the base color in ambient lighting.
This commit is contained in:
Henrik Rydgård committed 2013-06-05 02:50:37 -07:00
commit 417ccb576c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -350,7 +350,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;
}
}
+1 -1
View File
@@ -476,7 +476,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) %s);\n", i, specularStr, i, timesLightScale);
}
WRITE(p, " lightSum0.rgb += (u_lightambient%i + diffuse)%s;\n", i, timesLightScale);
WRITE(p, " lightSum0.rgb += (u_lightambient%i * %s.rgb + diffuse)%s;\n", i, ambientStr, timesLightScale);
}
if (gstate.isLightingEnabled()) {