removed shadowmapping

This commit is contained in:
Benjamin Kyd
2019-02-20 17:55:36 +00:00
parent 7e3e7324ad
commit b36dd004dc
5 changed files with 8 additions and 799 deletions

View File

@@ -16,15 +16,10 @@ vec3 objectColour = vec3(0.58, 0.61, 0.627);
vec3 lightColour = vec3(0.1, 0.45, 0.9);
float calculateShadow(vec4 fragPosLightSpace) {
// perform perspective divide
vec3 projCoords = fragPosLightSpace.xyz / fragPosLightSpace.w;
// transform to [0,1] range
projCoords = projCoords * 0.5 + 0.5;
// get closest depth value from light's perspective (using [0,1] range fragPosLight as coords)
float closestDepth = texture(shadowMap, projCoords.xy).r;
// get depth of current fragment from light's perspective
float currentDepth = projCoords.z;
// check whether current frag pos is in shadow
float shadow = currentDepth > closestDepth ? 1.0 : 0.0;
return shadow;