Fix texture seams (Fixes #23)

This commit is contained in:
Thinkofname 2016-04-05 22:40:35 +01:00
parent c73b9d48b2
commit c21a740077
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
const float invAtlasSize = 1.0 / 1024;
vec4 atlasTexture() {
vec2 tPos = vTextureOffset;
tPos = mod(tPos, vTextureInfo.zw);
tPos = clamp(tPos, vec2(0.1), vTextureInfo.zw - 0.1);
tPos += vTextureInfo.xy;
tPos *= invAtlasSize;
return texture(textures, vec3(tPos, vAtlas));