You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
384 B
GLSL

#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);
}