diff options
author | 2015-02-26 01:40:18 +0100 | |
---|---|---|
committer | 2015-02-26 01:40:18 +0100 | |
commit | eb8144a3bb8f5d443b5062b13e3e18b6b8e8c43c (patch) | |
tree | 0dbb6487e5cc7db623f2d9acd9d2db3efa792aca /src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh | |
parent | 2c2994aeb52b700c206ca6c94513a92601097bdb (diff) |
Moved opengl related stuff to modules/opengl
Diffstat (limited to 'src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh')
-rw-r--r-- | src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh new file mode 100644 index 00000000000..14c05aaa844 --- /dev/null +++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh @@ -0,0 +1,28 @@ + +#pragma optimize (on) +#pragma debug (off) + +uniform sampler2D color_texture; +uniform sampler2D colortable_texture; +uniform vec2 colortable_sz; // orig size for full bgr +uniform vec2 colortable_pow2_sz; // orig size for full bgr + +void main() +{ + vec4 color_tex; + vec2 color_map_coord; + float colortable_scale = (colortable_sz.x/3.0) / colortable_pow2_sz.x; + + // normalized texture coordinates .. + color_tex = texture2D(color_texture, gl_TexCoord[0].st) * ((colortable_sz.x/3.0)-1.0)/colortable_pow2_sz.x;// lookup space + + color_map_coord.x = color_tex.b; + gl_FragColor.b = texture2D(colortable_texture, color_map_coord).b; + + color_map_coord.x = color_tex.g + colortable_scale; + gl_FragColor.g = texture2D(colortable_texture, color_map_coord).g; + + color_map_coord.x = color_tex.r + 2.0 * colortable_scale; + gl_FragColor.r = texture2D(colortable_texture, color_map_coord).r; +} + |