Clamping diffuse+ambient light intensity to 1.0 (legacy engine)

This commit is contained in:
Bart Trzynadlowski 2016-04-04 04:32:10 +00:00
parent faf5f9cf48
commit 38d5d14157
2 changed files with 2 additions and 2 deletions

View file

@ -129,7 +129,7 @@ void main(void)
sunFactor = max(dot(sunVector,viewNormal),0.0); sunFactor = max(dot(sunVector,viewNormal),0.0);
// Total light intensity: sum of all components // Total light intensity: sum of all components
fsLightIntensity *= (sunFactor*lighting[1].x+lighting[1].y); fsLightIntensity *= min(1.0,(sunFactor*lighting[1].x+lighting[1].y));
/* /*
* Specular Lighting * Specular Lighting

View file

@ -164,7 +164,7 @@ static const char vertexShaderSource[] =
"\t\tsunFactor = max(dot(sunVector,viewNormal),0.0);\n" "\t\tsunFactor = max(dot(sunVector,viewNormal),0.0);\n"
"\t\t\n" "\t\t\n"
"\t\t// Total light intensity: sum of all components\n" "\t\t// Total light intensity: sum of all components\n"
"\t\tfsLightIntensity *= (sunFactor*lighting[1].x+lighting[1].y);\n" "\t\tfsLightIntensity *= min(1.0,(sunFactor*lighting[1].x+lighting[1].y));\n"
"\t\t\n" "\t\t\n"
"\t\t/*\n" "\t\t/*\n"
"\t\t * Specular Lighting\n" "\t\t * Specular Lighting\n"