stevenarella/src/render/shaders/lookup_texture.glsl

9 lines
258 B
Plaintext
Raw Normal View History

2015-09-17 11:04:25 -04:00
const float invAtlasSize = 1.0 / 1024;
vec4 atlasTexture() {
vec2 tPos = vTextureOffset;
2016-04-05 17:40:35 -04:00
tPos = clamp(tPos, vec2(0.1), vTextureInfo.zw - 0.1);
tPos += vTextureInfo.xy;
tPos *= invAtlasSize;
return texture(textures, vec3(tPos, vAtlas));
}