-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheffect_weather.frag
45 lines (33 loc) · 1.04 KB
/
effect_weather.frag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
///////////////////////////////////////////////////////
//*-------------------------------------------------*//
//| Part of Project One (https://www.maus-games.at) |//
//*-------------------------------------------------*//
//| Copyright (c) 2010 Martin Mauersics |//
//| Released under the zlib License |//
//*-------------------------------------------------*//
///////////////////////////////////////////////////////
// shader input
varying vec2 v_av2OverlayCoord[_P1_OVERLAYS_]; //
vec4 GetMultipleTextures()
{
vec4 v4Output = vec4(0.0);
//
for(int i = 0; i < (_P1_OVERLAYS_); ++i)
{
v4Output += coreTexture2D(0, v_av2OverlayCoord[i]);
}
//
return v4Output;
}
void FragmentMain()
{
#if defined(_P1_SINGLE_)
// draw only single channel
float v1Value = GetMultipleTextures().r;
gl_FragColor = vec4(u_v4Color.rgb, u_v4Color.a * v1Value);
#else
// draw color with alpha
vec4 v4Texture = GetMultipleTextures();
gl_FragColor = v4Texture * u_v4Color;
#endif
}