From 45ae4a2c662ba6aea159523dc5d1a479c81a5516 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Fri, 30 Jan 2015 15:11:00 +0100 Subject: [PATCH] Only sample shadows from the first light source. --- Shader/phong.fsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Shader/phong.fsh b/Shader/phong.fsh index f2756d4..337fc63 100644 --- a/Shader/phong.fsh +++ b/Shader/phong.fsh @@ -111,7 +111,9 @@ void main() vec3 cameraVector = normalize(camera - vec3(fragPosition)); specularColor += clamp(pow((dot((cameraVector+lightVector),normalize(vNormal))/(length(cameraVector+lightVector)*length(normalize(vNormal)))),shininess), 0.0, 1.0) *specularFactor*intensity*lightColors[i]; - visibility = samplePointShadow(shadowMap_cube, lightDirection); + if (i == 0) { + visibility = samplePointShadow(shadowMap_cube, lightDirection); + } } /*float value = texture(shadowMap_cube, lightDirection); oColor = vec4(value, value, value, 255);*/