aboutsummaryrefslogtreecommitdiff
path: root/shaders/view_texture.frag
blob: 12fa367a7b14061ae045db0085ac014e21a3e046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
uniform sampler2D Texture;

in vec2 Texcoord;

layout (location = 0) out vec4 Colour;

void main()
{
    // There is a question here whether we want to view the texture through the
    // sampler or unfiltered. Prefer the latter for now.
    //vec3 colour = texture(Texture, Texcoord).rgb;
    ivec2 st = ivec2(Texcoord * vec2(textureSize(Texture, 0)));
    vec3 colour = texelFetch(Texture, st, 0).rgb;
    Colour = vec4(pow(colour, vec3(1.0 / 2.2)), 1.0);
}