Merge pull request #539 from Lunarsong/patch-2

Removed redundant division by w
This commit is contained in:
Sascha Willems 2019-01-31 20:07:23 +01:00 committed by GitHub
commit 3eec106b47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,10 +14,9 @@ layout (location = 0) out vec4 outFragColor;
#define ambient 0.1 #define ambient 0.1
float textureProj(vec4 P, vec2 off) float textureProj(vec4 shadowCoord, vec2 off)
{ {
float shadow = 1.0; float shadow = 1.0;
vec4 shadowCoord = P / P.w;
if ( shadowCoord.z > -1.0 && shadowCoord.z < 1.0 ) if ( shadowCoord.z > -1.0 && shadowCoord.z < 1.0 )
{ {
float dist = texture( shadowMap, shadowCoord.st + off ).r; float dist = texture( shadowMap, shadowCoord.st + off ).r;
@ -65,4 +64,4 @@ void main()
outFragColor = vec4(diffuse * shadow, 1.0); outFragColor = vec4(diffuse * shadow, 1.0);
} }