2 Copyright 2012 Marten Richter
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
21 #ifndef FRAME_FRAG_SHADER_H
\r
22 #define FRAME_FRAG_SHADER_H
\r
24 const GLchar frame_frag_shader[] =
\r
25 "precision mediump float;\n"
\r
26 "uniform sampler2D textureU;\n"
\r
27 "uniform sampler2D textureV;\n"
\r
28 "uniform sampler2D textureY;\n"
\r
29 "const float uv_corr=0.5;\n"
\r
30 "const float y_corr=0.0625;\n"
\r
31 "const mat3 yuvtransform= mat3( 1.164 ,0.0 ,1.596 ,\n"
\r
32 " 1.164 ,-0.391,-0.813 ,\n"
\r
33 " 1.164,2.018 , 0.0 );\n"
\r
34 // "const mat3 yuvtransform= mat3( 1. ,1. ,1. ,\n"
\r
35 // " 0.0 ,-0.3960,2.029 ,\n"
\r
36 // " 1.140,-0.581 , 0.0 );\n"
\r
37 // "const mat3 yuvtransform= mat3( 1. ,0 ,0. ,\n"
\r
38 // " 0.0 ,1.,0. ,\n"
\r
39 // " 0.,0. , 1.0 );\n"
\r
40 // "const mat3 yuvtransform= mat3( 1. ,1. ,1. ,\n"
\r
41 // " 0.0 ,-0.03960,0.2029 ,\n"
\r
42 // " 0.1140,-0.0581 , 0.0 );\n"
\r
43 "varying vec2 out_texCoord;\n"
\r
46 // " vec3 inputcoloryuv=vec3(texture2D(textureY,out_texCoord).r-y_corr,0,0);\n"
\r
47 //" texture2D(textureU,out_texCoord)-uv_corr,"
\r
48 //" texture2D(textureV,out_texCoord)-uv_corr);"
\r
49 // " gl_FragColor.rgb=yuvtransform*inputcoloryuv;\n"
\r
51 "help.x=texture2D(textureY,out_texCoord).r-y_corr;\n"
\r
52 "help.y=texture2D(textureU,out_texCoord).r-uv_corr;\n"
\r
53 "help.z=texture2D(textureV,out_texCoord).r-uv_corr;\n" //-uv_corr;\n"
\r
54 " gl_FragColor.rgb=help*yuvtransform;\n"
\r
55 //" gl_FragColor.g=texture2D(textureU,out_texCoord).r;\n"
\r
56 //" gl_FragColor.b=texture2D(textureV,out_texCoord).r;\n"
\r
57 " gl_FragColor.a=1.;\n"
\r
58 // " gl_FragColor=texture2D(texture,out_texCoord);\n"
\r
59 //" vec4 temp=vec4(0.3,0.4,0.5,0.5);\n"
\r
60 //"gl_FragColor=temp;\n"
\r