removed shadowmapping
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user