1 /* DooM2D: Midnight on the Firing Line
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 uniform sampler2D texBg; // background
23 uniform sampler2D texOcc; // occluders
24 uniform sampler2D texOccSmall; // occluders, small map
25 uniform vec2 mapPixSize;
26 uniform vec4 lightColor;
27 //uniform vec2 lightPos;
30 //gl_FragCoord: [0..lightTexSize)
36 vec2 btxy = gl_FragCoord.xy;
37 //btxy.y = mapPixSize.y-btxy.y-1.0;
38 //vec2 ocxy = vec2(btxy.x, mapPixSize.y-btxy.y)/mapPixSize;
41 // has some light here
42 vec4 bcolor = texture2D(texBg, btxy/mapPixSize);
43 if (lightColor.r+lightColor.g+lightColor.b == 0.0) {
44 color = bcolor*vec4(vec3(lightColor.a), lit);
46 color = lightColor*lit;