Line data Source code
1 : // Generated file - Edit roiFragmentShaderRGB.glsl!
2 : #include <string>
3 10 : static const std::string roiFragmentShaderRGB_glsl =
4 : "/* Copyright (c) 2009 Maxim Makhinya\n *\n * This library is free "
5 : "software; you can redistribute it and/or modify it under\n * the terms "
6 : "of the GNU Lesser General Public License version 2.1 as published\n * by "
7 : "the Free Software Foundation.\n * \n * This library is distributed in "
8 : "the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without "
9 : "even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A "
10 : "PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n "
11 : " * details.\n * \n * You should have received a copy of the GNU Lesser "
12 : "General Public License\n * along with this library; if not, write to the "
13 : "Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, "
14 : "Boston, MA 02110-1301 USA.\n */\n \n uniform sampler2DRect texture;\n \n "
15 : "void main(void)\n {\n vec2 pos = (gl_FragCoord.xy - vec2( 0.5, 0.5 "
16 : "))*16.0;\n \n float bg = 1.0;\n \n vec3 s;\n for( float y = "
17 : ".0; y < 15.1; y+=2.0 )\n {\n if( bg < .5 )\n "
18 : "break;\n for( float x = .0; x < 15.1; x+=2.0 )\n {\n "
19 : " s = texture2DRect( texture, pos + vec2( x, y )).rgb;\n "
20 : "if( s != vec3( .0, .0, .0 ))\n {\n bg = .0;\n "
21 : " break;\n }\n }\n }\n for( "
22 : "float y = 1.0; y < 15.1; y+=2.0 )\n {\n if( bg < .5 )\n "
23 : " break;\n for( float x = 1.0; x < 15.1; x+=2.0 )\n "
24 : "{\n s = texture2DRect( texture, pos + vec2( x, y )).rgb;\n \n "
25 : " if( s != vec3( .0, .0, .0 ))\n {\n "
26 : " bg = .0;\n break;\n }\n }\n }\n "
27 : " for( float y = .0; y < 15.1; y+=2.0 )\n {\n if( bg < .5 "
28 : ")\n break;\n for( float x = 1.0; x < 15.1; x+=2.0 )\n "
29 : " {\n s = texture2DRect( texture, pos + vec2( x, y "
30 : ")).rgb;\n \n if( s != vec3( .0, .0, .0 ))\n {\n "
31 : " bg = .0;\n break;\n }\n "
32 : "}\n }\n for( float y = 1.0; y < 15.1; y+=2.0 )\n {\n "
33 : "if( bg < .5 )\n break;\n for( float x = .0; x < 15.1; "
34 : "x+=2.0 )\n {\n s = texture2DRect( texture, pos + "
35 : "vec2( x, y )).rgb;\n \n if( s != vec3( .0, .0, .0 ))\n "
36 : " {\n bg = .0;\n break;\n "
37 : "}\n }\n }\n \n gl_FragColor = vec4( bg, .0, .0, .0 );\n "
38 : "}\n ";
|