fixed pixel snap precision artifact

This commit is contained in:
clayjohn 2019-03-03 23:25:35 -08:00
parent 8d117b214f
commit b804c491b7
2 changed files with 6 additions and 0 deletions

View file

@ -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

View file

@ -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