summaryrefslogtreecommitdiff
path: root/data/shader.fs
blob: a79c8fdf843c87b74370d859091d23010041de90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 140
// -*- mode: C -*-
// Defines emitted by gridrectst::init_gl at load:
// dimx, dimy:      Grid size of the screen array
// dispx, dispy:    Grid-cell (font) size
// vec4 colors[16]: Color palette; first non-bold, then bold

out vec4 gl_FragColor;

flat in vec4 frontColor;
flat in vec4 backColor;

smooth in vec2 texCoords;
uniform sampler2D textures;

void main() {
  vec4 texColor = texture2D(textures, texCoords);

  gl_FragColor = mix(backColor, frontColor * texColor, texColor.a);
}