1#version 120
2uniform float cloudpos1_x;
3uniform float cloudpos1_y;
4uniform float cloudpos2_x;
5uniform float cloudpos2_y;
6uniform float cloudpos3_x;
7uniform float cloudpos3_y;
8uniform float cloudpos4_x;
9uniform float cloudpos4_y;
10uniform float cloudpos5_x;
11uniform float cloudpos5_y;
12uniform float cloudpos6_x;
13uniform float cloudpos6_y;
14uniform float cloudpos7_x;
15uniform float cloudpos7_y;
16uniform float cloudpos8_x;
17uniform float cloudpos8_y;
18uniform float cloudpos9_x;
19uniform float cloudpos9_y;
20uniform float cloudpos10_x;
21uniform float cloudpos10_y;
22uniform float cloudpos11_x;
23uniform float cloudpos11_y;
24uniform float cloudpos12_x;
25uniform float cloudpos12_y;
26uniform float cloudpos13_x;
27uniform float cloudpos13_y;
28uniform float cloudpos14_x;
29uniform float cloudpos14_y;
30uniform float cloudpos15_x;
31uniform float cloudpos15_y;
32uniform float cloudpos16_x;
33uniform float cloudpos16_y;
34uniform float cloudpos17_x;
35uniform float cloudpos17_y;
36uniform float cloudpos18_x;
37uniform float cloudpos18_y;
38uniform float cloudpos19_x;
39uniform float cloudpos19_y;
40uniform float cloudpos20_x;
41uniform float cloudpos20_y;
42
43uniform float cloudpos_n_x;
44uniform float cloudpos_n_y;
45
46float shadow_func (in float x, in float y, in float noise, in float dist)
47{
48
49if (dist > 30000.0) {return 1.0;}
50
51float width =  fract((cloudpos1_x)) * 5000.0;
52float strength = fract((cloudpos1_y));
53
54
55float dlength = length( vec2 (x - cloudpos1_x, y - cloudpos1_y));
56float shadeValue = strength * (1.0-smoothstep(width * 0.5, width, dlength));
57
58dlength = length ( vec2 (x - cloudpos2_x, y - cloudpos2_y));
59width = fract((cloudpos2_x)) * 5000.0; strength = fract((cloudpos2_y));
60shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
61
62dlength = length ( vec2 (x - cloudpos3_x, y - cloudpos3_y));
63width = fract((cloudpos3_x)) * 5000.0; strength = fract((cloudpos3_y));
64shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
65
66dlength = length ( vec2 (x - cloudpos4_x, y - cloudpos4_y));
67width = fract((cloudpos4_x)) * 5000.0; strength = fract((cloudpos4_y));
68shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
69
70dlength = length ( vec2 (x - cloudpos5_x, y - cloudpos5_y));
71width = fract((cloudpos5_x)) * 5000.0; strength = fract((cloudpos5_y));
72shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
73
74dlength = length ( vec2 (x - cloudpos6_x, y - cloudpos6_y));
75width = fract((cloudpos6_x)) * 5000.0; strength = fract((cloudpos6_y));
76shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
77
78dlength = length ( vec2 (x - cloudpos7_x, y - cloudpos7_y));
79width = fract((cloudpos7_x)) * 5000.0; strength = fract((cloudpos7_y));
80shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
81
82dlength = length ( vec2 (x - cloudpos8_x, y - cloudpos8_y));
83width = fract((cloudpos8_x)) * 5000.0; strength = fract((cloudpos8_y));
84shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
85
86dlength = length ( vec2 (x - cloudpos9_x, y - cloudpos9_y));
87width = fract((cloudpos9_x)) * 5000.0; strength = fract((cloudpos9_y));
88shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
89
90dlength = length ( vec2 (x - cloudpos10_x, y - cloudpos10_y));
91width = fract((cloudpos10_x)) * 5000.0; strength = fract((cloudpos10_y));
92shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
93
94dlength = length ( vec2 (x - cloudpos11_x, y - cloudpos11_y));
95width = fract((cloudpos11_x)) * 5000.0; strength = fract((cloudpos11_y));
96shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
97
98dlength = length ( vec2 (x - cloudpos12_x, y - cloudpos12_y));
99width = fract((cloudpos12_x)) * 5000.0; strength = fract((cloudpos12_y));
100shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
101
102dlength = length ( vec2 (x - cloudpos13_x, y - cloudpos13_y));
103width = fract((cloudpos13_x)) * 5000.0; strength = fract((cloudpos13_y));
104shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
105
106dlength = length ( vec2 (x - cloudpos14_x, y - cloudpos14_y));
107width = fract((cloudpos14_x)) * 5000.0; strength = fract((cloudpos14_y));
108shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
109
110dlength = length ( vec2 (x - cloudpos15_x, y - cloudpos15_y));
111width = fract((cloudpos15_x)) * 5000.0; strength = fract((cloudpos15_y));
112shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
113
114dlength = length ( vec2 (x - cloudpos16_x, y - cloudpos16_y));
115width = fract((cloudpos16_x)) * 5000.0; strength = fract((cloudpos16_y));
116shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
117
118dlength = length ( vec2 (x - cloudpos17_x, y - cloudpos17_y));
119width = fract((cloudpos17_x)) * 5000.0; strength = fract((cloudpos17_y));
120shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
121
122dlength = length ( vec2 (x - cloudpos18_x, y - cloudpos18_y));
123width = fract((cloudpos18_x)) * 5000.0; strength = fract((cloudpos18_y));
124shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
125
126dlength = length ( vec2 (x - cloudpos19_x, y - cloudpos19_y));
127width = fract((cloudpos19_x)) * 5000.0; strength = fract((cloudpos19_y));
128shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
129
130dlength = length ( vec2 (x - cloudpos20_x, y - cloudpos20_y));
131width = fract((cloudpos20_x)) * 5000.0; strength = fract((cloudpos20_y));
132shadeValue = shadeValue + strength * (1.0-smoothstep(width * 0.5, width, dlength));
133
134shadeValue =  shadeValue * (0.8 + 2.0 * shadeValue * smoothstep(0.4,0.6,noise));
135shadeValue = clamp(shadeValue,0.0,1.0);
136shadeValue = shadeValue * (1.0 - smoothstep(15000.0, 30000.0,dist));
137
138return 1.0 - shadeValue;
139
140}
141
142
143float shadow_func_nearest (in float x, in float y, in float noise, in float dist)
144{
145
146if (dist > 6000.0) {return 1.0;}
147
148float width =  fract((cloudpos_n_x)) * 5000.0;
149float strength = fract((cloudpos_n_y));
150
151
152float dlength = length( vec2 (x - cloudpos_n_x, y - cloudpos_n_y));
153float shadeValue = strength * (1.0-smoothstep(width * 0.5, width, dlength));
154
155return 1.0 - shadeValue;
156}
157