#version 330 core out vec4 FragColor; in vec3 ourColor; in vec2 TexCoord; uniform sampler2D ourTexture; uniform ivec2 viewportSize; void main() { ivec2 txtSize = textureSize(ourTexture, 0); vec2 coord = vec2(gl_FragCoord.x / txtSize.x, (viewportSize.y - gl_FragCoord.y) / txtSize.y); float rest = coord.y - floor(coord.y); FragColor = texture(ourTexture, coord); }