Subversion Repositories Games.Carmageddon

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
#version 140
2
#extension GL_ARB_explicit_attrib_location : require
3
 
4
in vec2 v_tex_coord;
5
 
6
uniform usampler2D u_pixels;
7
uniform sampler2D u_palette;
8
 
9
layout (location = 0) out vec4 out_frag_color;
10
 
11
void main(void) {
12
  uint palette_index = texture(u_pixels, v_tex_coord.xy).r;
13
  vec4 texel = texelFetch(u_palette, ivec2(palette_index, 0), 0);
14
  out_frag_color = vec4(texel.bgra);
15
}