@@ -111,11 +111,11 @@ vec4 effect( vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords
111111 );
112112 noise = fract (sin (noise) * 0.0 ); // 143758.5453);
113113
114- vec2 offset = 1 / image_details* vec2 (1 ,0 );
114+ vec2 offset = 1 . /image_details* vec2 (1 ,0 );
115115 vec4 tex = Texel(texture, texture_coords);
116116 tex.r = Texel(texture,texture_coords+ offset).r;
117117 tex.rgb += vec3 (0.0 ,- 0.1 ,0.2 )- fractured.x* 0.1 ;
118- tex.rgb += max (0 , pow (noise.x* noise.y,8 ));
118+ tex.rgb += max (0 . , pow (noise.x* noise.y,8 . ));
119119 number low = min (tex.r, min (tex.g, tex.b));
120120 number high = max (tex.r, max (tex.g, tex.b));
121121 number delta = high - low;
@@ -158,11 +158,11 @@ vec4 effect( vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords
158158
159159 float t2 = t/ 250.0 ; // animation speed
160160 const int TileC = 40 ; // tile count
161- float fracOff = 10 ; // offset of fractures
161+ float fracOff = 10 . ; // offset of fractures
162162
163163
164- float light = 0 ;
165- float uvScale = 3 ;
164+ float light = 0 . ;
165+ float uvScale = 3 . ;
166166
167167 float cX = uv_scaled_centered.x * 0.05 * uvScale;
168168 float cY = uv_scaled_centered.y * 0.05 * uvScale;
@@ -171,22 +171,23 @@ vec4 effect( vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords
171171 float pointPlats[TileC];
172172
173173 for (int i= 0 ; i< TileC; i += 2 ){
174-
175- pointCenters[i][0 ] = pow (1.73 * (2.0 + sin (3.38 * (0.3 + i / 3.0 ) * (0.17 + i ))), - 1 ) * cos (t2 + 11.0 * i );
176- pointCenters[i][1 ] = pow (1.17 * (2.0 + cos (2.11 * (0.3 + i / 5.0 ) * (0.31 + i ))), - 1 ) * sin (t2 + 7.0 * i + 2.0 );
174+ float i_float = float (i);
175+ pointCenters[i][0 ] = pow (1.73 * (2.0 + sin (3.38 * (0.3 + i_float / 3.0 ) * (0.17 + i_float ))), - 1 . ) * cos (t2 + 11.0 * i_float );
176+ pointCenters[i][1 ] = pow (1.17 * (2.0 + cos (2.11 * (0.3 + i_float / 5.0 ) * (0.31 + i_float ))), - 1 . ) * sin (t2 + 7.0 * i_float + 2.0 );
177177 float vecSize = pointCenters[i][0 ]* pointCenters[i][0 ] + pointCenters[i][1 ]* pointCenters[i][1 ];
178178 pointCenters[i][0 ] = pointCenters[i][0 ] / (vecSize + 0.1 );
179179 pointCenters[i][1 ] = pointCenters[i][1 ] / (vecSize + 0.1 );
180180 pointPlats[i] = 0.0 ;
181181 }
182182
183- for (int i= 0 ; i< TileC; i += 2 ){
184- float rescale = mod (i, 5 ) - 1.0 ;
183+ for (int i= 0 ; i< TileC; i += 2 ){
184+ float i_float = float (i);
185+ float rescale = mod (i_float, 5 .) - 1.0 ;
185186 rescale = max (0.0 , rescale);
186187 rescale = min (1.0 , rescale);
187- rescale = 2.8 * rescale + 0.2 + sin (i + t2 + 0.11 )* 0.3 ;
188- pointCenters[i+ 1 ][0 ] = pointCenters[i][0 ]* rescale + sin (i + 0.1 )/ 8 ;
189- pointCenters[i+ 1 ][1 ] = pointCenters[i][1 ]* rescale + cos (i + 0.1 )/ 8 ;
188+ rescale = 2.8 * rescale + 0.2 + sin (i_float + t2 + 0.11 )* 0.3 ;
189+ pointCenters[i+ 1 ][0 ] = pointCenters[i][0 ]* rescale + sin (i_float + 0.1 )/ 8 . ;
190+ pointCenters[i+ 1 ][1 ] = pointCenters[i][1 ]* rescale + cos (i_float + 0.1 )/ 8 . ;
190191 pointPlats[i] = 0.0 ;
191192 }
192193
@@ -195,20 +196,22 @@ vec4 effect( vec4 colour, Image texture, vec2 texture_coords, vec2 screen_coords
195196 }
196197
197198 for (int i= 0 ; i< TileC; i++ ){
198- pointPlats[i] = floor (0.001 + (1 / (1 + pow (pointCenters[i][0 ] - cX, 2.0 ) + pow (pointCenters[i][1 ] - cY, 2.0 )))/ light);
199+ pointPlats[i] = floor (0.001 + (1 . /(1 . + pow (pointCenters[i][0 ] - cX, 2.0 ) + pow (pointCenters[i][1 ] - cY, 2.0 )))/ light);
199200 }
200201
201202 float col = 0.0 ;
202203 float qalph = 0.0 ;
203204 float ShiftX = 0.0 ;
204205 float ShiftY = 0.0 ;
205206
206- for (int i= 0 ; i< TileC; i++ ){
207+ for (int i= 0 ; i < TileC; i++ ){
208+ float i_float = float (i);
209+ float TileC_float = float (TileC);
207210 float dist = pow (pointCenters[i][0 ], 2.0 ) + pow (pointCenters[i][1 ], 2.0 );
208- col += min (1.0 , pointPlats[i]) * i / TileC ;
211+ col += min (1.0 , pointPlats[i]) * i_float / TileC_float ;
209212 qalph += min (1.0 , pointPlats[i]) * pow (dist, 0.75 );
210- ShiftX += min (1.0 , pointPlats[i]) * pointCenters[i][0 ]/ (1.0 + pow (pointCenters[i][0 ], 2 )) * sin (0.23 * i + 0.31 - t2/ 51.0 );
211- ShiftY += min (1.0 , pointPlats[i]) * pointCenters[i][1 ]/ (1.0 + pow (pointCenters[i][1 ], 2 )) * cos (0.17 * i + 0.81 + t2/ 12.0 );
213+ ShiftX += min (1.0 , pointPlats[i]) * pointCenters[i][0 ]/ (1.0 + pow (pointCenters[i][0 ], 2 . )) * sin (0.23 * i_float + 0.31 - t2/ 51.0 );
214+ ShiftY += min (1.0 , pointPlats[i]) * pointCenters[i][1 ]/ (1.0 + pow (pointCenters[i][1 ], 2 . )) * cos (0.17 * i_float + 0.81 + t2/ 12.0 );
212215 }
213216
214217 hsl.y += 0.33 ;
0 commit comments