aboutsummaryrefslogtreecommitdiff
path: root/shaders/view_texture.frag
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/view_texture.frag')
-rw-r--r--shaders/view_texture.frag15
1 files changed, 15 insertions, 0 deletions
diff --git a/shaders/view_texture.frag b/shaders/view_texture.frag
new file mode 100644
index 0000000..12fa367
--- /dev/null
+++ b/shaders/view_texture.frag
@@ -0,0 +1,15 @@
1uniform sampler2D Texture;
2
3in vec2 Texcoord;
4
5layout (location = 0) out vec4 Colour;
6
7void main()
8{
9 // There is a question here whether we want to view the texture through the
10 // sampler or unfiltered. Prefer the latter for now.
11 //vec3 colour = texture(Texture, Texcoord).rgb;
12 ivec2 st = ivec2(Texcoord * vec2(textureSize(Texture, 0)));
13 vec3 colour = texelFetch(Texture, st, 0).rgb;
14 Colour = vec4(pow(colour, vec3(1.0 / 2.2)), 1.0);
15}