Skip to content

Commit

Permalink
Fix shadow acne on shadow mapping example
Browse files Browse the repository at this point in the history
  • Loading branch information
chicio committed Sep 12, 2016
1 parent ff1b7de commit 359ea18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Chapter_14/Shadows/Shadows.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int InitShadowMap ( ESContext *esContext )

glGenTextures ( 1, &userData->shadowMapTextureId );
glBindTexture ( GL_TEXTURE_2D, userData->shadowMapTextureId );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
Expand Down Expand Up @@ -281,7 +281,7 @@ int Init ( ESContext *esContext )
" float pixelSize = 0.002; // 1/500 \n"
" vec4 offset = vec4 ( x * pixelSize * v_shadowCoord.w, \n"
" y * pixelSize * v_shadowCoord.w, \n"
" 0.0, 0.0 ); \n"
" -0.005 * v_shadowCoord.w, 0.0 ); \n"
" return textureProj ( s_shadowMap, v_shadowCoord + offset ); \n"
"} \n"
" \n"
Expand Down

0 comments on commit 359ea18

Please sign in to comment.