4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2008,2009 Intel Corporation.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the
20
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21
* Boston, MA 02111-1307, USA.
25
const char cogl_fixed_fragment_shader_variables_start[] =
27
"/* There is no default precision for floats in fragment shaders in\n"
28
" GLES 2 so we need to define one */\n"
29
"precision highp float;\n"
32
const char cogl_fixed_fragment_shader_inputs[] =
34
"/* Inputs from the vertex shader */\n"
35
"varying vec4 frag_color;\n"
36
"varying float fog_amount;\n"
39
const char cogl_fixed_fragment_shader_texturing_options[] =
41
"/* Texturing options */\n"
44
const char cogl_fixed_fragment_shader_fogging_options[] =
46
"/* Fogging options */\n"
47
"uniform vec4 fog_color;\n"
49
"/* Alpha test options */\n"
50
"uniform float alpha_test_ref;\n"
53
const char cogl_fixed_fragment_shader_main_declare[] =
59
const char cogl_fixed_fragment_shader_main_start[] =
63
const char cogl_fixed_fragment_shader_fog[] =
65
" /* Mix the calculated color with the fog color */\n"
66
" gl_FragColor.rgb = mix (fog_color.rgb, gl_FragColor.rgb, fog_amount);\n"
68
" /* Alpha testing */\n"
71
const char cogl_fixed_fragment_shader_alpha_never[] =
74
const char cogl_fixed_fragment_shader_alpha_less[] =
75
" if (gl_FragColor.a >= alpha_test_ref)\n"
78
const char cogl_fixed_fragment_shader_alpha_equal[] =
79
" if (gl_FragColor.a != alpha_test_ref)\n"
82
const char cogl_fixed_fragment_shader_alpha_lequal[] =
83
" if (gl_FragColor.a > alpha_test_ref)\n"
86
const char cogl_fixed_fragment_shader_alpha_greater[] =
87
" if (gl_FragColor.a <= alpha_test_ref)\n"
90
const char cogl_fixed_fragment_shader_alpha_notequal[] =
91
" if (gl_FragColor.a == alpha_test_ref)\n"
94
const char cogl_fixed_fragment_shader_alpha_gequal[] =
95
" if (gl_FragColor.a < alpha_test_ref)\n"
99
const char cogl_fixed_fragment_shader_end[] =