Only sample shadows from the first light source.

This commit is contained in:
Fabian Klemp 2015-01-30 15:11:00 +01:00
parent a3e6da2ada
commit 60372cf1a1

View File

@ -111,8 +111,10 @@ void main()
vec3 cameraVector = normalize(camera - vec3(fragPosition)); 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) specularColor += clamp(pow((dot((cameraVector+lightVector),normalize(vNormal))/(length(cameraVector+lightVector)*length(normalize(vNormal)))),shininess), 0.0, 1.0)
*specularFactor*intensity*lightColors[i]; *specularFactor*intensity*lightColors[i];
if (i == 0) {
visibility = samplePointShadow(shadowMap_cube, lightDirection); visibility = samplePointShadow(shadowMap_cube, lightDirection);
} }
}
/*float value = texture(shadowMap_cube, lightDirection); /*float value = texture(shadowMap_cube, lightDirection);
oColor = vec4(value, value, value, 255);*/ oColor = vec4(value, value, value, 255);*/
} }