diff --git a/Src/Graphics/Legacy3D/Shaders/Vertex.glsl b/Src/Graphics/Legacy3D/Shaders/Vertex.glsl index 5dbbb48..8489abd 100644 --- a/Src/Graphics/Legacy3D/Shaders/Vertex.glsl +++ b/Src/Graphics/Legacy3D/Shaders/Vertex.glsl @@ -129,7 +129,7 @@ void main(void) sunFactor = max(dot(sunVector,viewNormal),0.0); // 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 diff --git a/Src/Graphics/Legacy3D/Shaders3D.h b/Src/Graphics/Legacy3D/Shaders3D.h index befcbe6..4a9c433 100644 --- a/Src/Graphics/Legacy3D/Shaders3D.h +++ b/Src/Graphics/Legacy3D/Shaders3D.h @@ -164,7 +164,7 @@ static const char vertexShaderSource[] = "\t\tsunFactor = max(dot(sunVector,viewNormal),0.0);\n" "\t\t\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 * Specular Lighting\n"