Skip to content

Commit

Permalink
Merge pull request #26567 from clayjohn/pixel_snap_artifact
Browse files Browse the repository at this point in the history
Fixed pixel snap precision artifact
  • Loading branch information
akien-mga committed Mar 4, 2019
2 parents ab11496 + b804c49 commit b753223
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gles2/shaders/canvas.glsl
Expand Up @@ -162,6 +162,9 @@ VERTEX_SHADER_CODE

#ifdef USE_PIXEL_SNAP
outvec.xy = floor(outvec + 0.5).xy;
// precision issue on some hardware creates artifacts within texture
// offset uv by a small amount to avoid
uv += 1e-5;
#endif

#ifdef USE_SKELETON
Expand Down
3 changes: 3 additions & 0 deletions drivers/gles3/shaders/canvas.glsl
Expand Up @@ -173,6 +173,9 @@ VERTEX_SHADER_CODE

#ifdef USE_PIXEL_SNAP
outvec.xy = floor(outvec + 0.5).xy;
// precision issue on some hardware creates artifacts within texture
// offset uv by a small amount to avoid
uv_interp += 1e-5;
#endif

#ifdef USE_SKELETON
Expand Down

0 comments on commit b753223

Please sign in to comment.