File: image.fragment.glsl

package info (click to toggle)
gl-image-display 0.23-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 256 kB
  • sloc: ansic: 1,003; cpp: 794; makefile: 102; python: 47
file content (24 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* -*- c -*- */
#version 330

layout(location = 0) out vec3 frag_color;
in vec2 tex_xy_fragment;
uniform int black_image;
uniform sampler2D tex;

void main(void)
{
    if(black_image != 0)
    {
        frag_color = vec3(0.,0.,0.);
    }
    else if(tex_xy_fragment.x < 0. || tex_xy_fragment.x > 1. ||
       tex_xy_fragment.y < 0. || tex_xy_fragment.y > 1.)
    {
        discard;
    }
    else
    {
        frag_color = texture(tex, tex_xy_fragment).xyz;
    }
}