-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquad_fs.glsl
62 lines (40 loc) · 1.17 KB
/
quad_fs.glsl
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#version 400
uniform float moonposition;
uniform sampler2D tex;
out vec4 fragcolor;
in vec2 pos;
void main(void)
{
if (moonposition>=171.886&&moonposition<=176.599)
{fragcolor = vec4(0.26,0.33,0.96,1.0)*(moonposition-176.599)/(171.886-176.599);
return;
}
else if (moonposition>=176.599&&moonposition<=183.468)
{fragcolor = vec4(0.0,0.0,0.0,1.0);
return;
}
else if(moonposition>=183.468&&moonposition<=188.249)
{fragcolor = vec4(0.26,0.33,0.96,1.0)*(moonposition-183.468)/(188.249-183.468);
return;
}
else {fragcolor = vec4(0.26,0.33,0.96,1.0);
return;
}
/*
vec4 tex_color = texture(tex, pos);
if (moonposition>=171.886&&moonposition<=176.599)
{fragcolor = tex_color*(moonposition-176.599)/(171.886-176.599);
return;
}
else if (moonposition>=176.599&&moonposition<=183.468)
{fragcolor = vec4(0.0,0.0,0.0,1.0);
return;
}
else if(moonposition>=183.468&&moonposition<=188.249)
{fragcolor = tex_color*(moonposition-183.468)/(188.249-183.468);
return;
}
else {fragcolor = tex_color;
return;
}*/
}