summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-02-26 01:40:18 +0100
committer couriersud <couriersud@arcor.de>2015-02-26 01:40:18 +0100
commiteb8144a3bb8f5d443b5062b13e3e18b6b8e8c43c (patch)
tree0dbb6487e5cc7db623f2d9acd9d2db3efa792aca /src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c
parent2c2994aeb52b700c206ca6c94513a92601097bdb (diff)
Moved opengl related stuff to modules/opengl
Diffstat (limited to 'src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c')
-rw-r--r--src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c
new file mode 100644
index 00000000000..d1263ea6864
--- /dev/null
+++ b/src/osd/modules/opengl/shader/glsl_plain_rgb32_lut.fsh.c
@@ -0,0 +1,30 @@
+const char glsl_plain_rgb32_lut_fsh_src[] =
+"\n"
+"#pragma optimize (on)\n"
+"#pragma debug (off)\n"
+"\n"
+"uniform sampler2D color_texture;\n"
+"uniform sampler2D colortable_texture;\n"
+"uniform vec2 colortable_sz; // orig size for full bgr\n"
+"uniform vec2 colortable_pow2_sz; // orig size for full bgr\n"
+"\n"
+"void main()\n"
+"{\n"
+" vec4 color_tex;\n"
+" vec2 color_map_coord;\n"
+" float colortable_scale = (colortable_sz.x/3.0) / colortable_pow2_sz.x;\n"
+"\n"
+" // normalized texture coordinates ..\n"
+" color_tex = texture2D(color_texture, gl_TexCoord[0].st) * ((colortable_sz.x/3.0)-1.0)/colortable_pow2_sz.x;// lookup space \n"
+"\n"
+" color_map_coord.x = color_tex.b;\n"
+" gl_FragColor.b = texture2D(colortable_texture, color_map_coord).b;\n"
+"\n"
+" color_map_coord.x = color_tex.g + colortable_scale;\n"
+" gl_FragColor.g = texture2D(colortable_texture, color_map_coord).g;\n"
+"\n"
+" color_map_coord.x = color_tex.r + 2.0 * colortable_scale;\n"
+" gl_FragColor.r = texture2D(colortable_texture, color_map_coord).r;\n"
+"}\n"
+"\n"
+;