FastLED 3.9.3
Loading...
Searching...
No Matches
animartrix_detail.hpp
1#pragma once
2
3/*
4 ___ _ ___ ______ _____ _
5 / _ \ (_) / _ \ | ___ \_ _| (_)
6/ /_\ \_ __ _ _ __ ___ / /_\ \| |_/ / | |_ __ ___ __
7| _ | '_ \| | '_ ` _ \| _ || / | | '__| \ \/ /
8| | | | | | | | | | | | | | | || |\ \ | | | | |> <
9\_| |_/_| |_|_|_| |_| |_\_| |_/\_| \_| \_/_| |_/_/\_\
10
11by Stefan Petrick 2023.
12
13High quality LED animations for your next project.
14
15This is a Shader and 5D Coordinate Mapper made for realtime
16rendering of generative animations & artistic dynamic visuals.
17
18This is also a modular animation synthesizer with waveform
19generators, oscillators, filters, modulators, noise generators,
20compressors... and much more.
21
22VO.42 beta version
23
24This code is licenced under a Creative Commons Attribution
25License CC BY-NC 3.0
26
27*/
28
29#include <vector> // ok include
30#include <math.h> // ok include
31#include <stdint.h>
32
33#ifndef ANIMARTRIX_INTERNAL
34#error "This file is not meant to be included directly. Include animartrix.hpp instead."
35#endif
36
37// Copyright Stefen Petrick 2023.
38// Adapted to C++ by Netmindz 2023.
39// Adapted to FastLED by Zach Vorhies 2024.
40// Licensed under the Creative Commons Attribution License CC BY-NC 3.0
41// https://creativecommons.org/licenses/by-nc/3.0/
42// This header is distributed with FastLED but has a different license that limits commercial use.
43// If you include this high quality LED animation library in your project, you must agree to the licensing terms.
44// It is not included by FastLED by default, you must include it manually.
45// Setting FASTLED_ANIMARTRIX_LICENSING_AGREEMENT=1 will indicate that you agree to the licensing terms of the ANIMartRIX library for non commercial use only.
46//
47// Like the rest of FastLED, this header is free for non-commercial use and licensed under the Creative Commons Attribution License CC BY-NC 3.0.
48// If you are just making art, then by all means do what you want with this library and you can stop reading now.
49// If you are using this header for commercial purposes, then you need to contact Stefan Petrick for a commercial use license.
50
51
52
53
54#include "force_inline.h"
55#include "namespace.h"
56
57// Setting this to 1 means you agree to the licensing terms of the ANIMartRIX library for non commercial use only.
58#if defined(FASTLED_ANIMARTRIX_LICENSING_AGREEMENT) || (FASTLED_ANIMARTRIX_LICENSING_AGREEMENT != 0)
59#warning "Warning: Non-standard license. This fx header is separate from the FastLED driver and carries different licensing terms. On the plus side, IT'S FUCKING AMAZING. ANIMartRIX: free for non-commercial use and licensed under the Creative Commons Attribution License CC BY-NC-SA 4.0. If you'd like to purchase a commercial use license please contact Stefan Petrick. Github: github.com/StefanPetrick/animartrix Reddit: reddit.com/user/StefanPetrick/ Modified by github.com/netmindz for class portability. Ported into FastLED by Zach Vorhies."
60#endif //
61
62
63#ifndef PI
64#define PI 3.1415926535897932384626433832795
65#endif
66
67#ifdef ANIMARTRIX_PRINT_USES_SERIAL
68#define ANIMARTRIX_PRINT_USES_SERIAL(S) Serial.print(S)
69#else
70#define ANIMARTRIX_PRINT(S) (void)(S)
71#endif
72
73#define num_oscillators 10
74
75namespace animartrix_detail {
76
78
79 // TODO float center_x = (num_x / 2) - 0.5; // center of the matrix
80 // TODO float center_y = (num_y / 2) - 0.5;
81 float center_x = (999 / 2) - 0.5; // center of the matrix
82 float center_y = (999 / 2) - 0.5;
83 float dist, angle;
84 float scale_x = 0.1; // smaller values = zoom in
85 float scale_y = 0.1;
86 float scale_z = 0.1;
87 float offset_x, offset_y, offset_z;
88 float z;
89 float low_limit = 0; // getting contrast by highering the black point
90 float high_limit = 1;
91};
92
93
95
96 float master_speed; // global transition speed
97 float
98 offset[num_oscillators]; // oscillators can be shifted by a time offset
99 float ratio[num_oscillators]; // speed ratios for the individual oscillators
100};
101
102
104
105 float linear[num_oscillators]; // returns 0 to FLT_MAX
106 float radial[num_oscillators]; // returns 0 to 2*PI
107 float directional[num_oscillators]; // returns -1 to 1
108 float noise_angle[num_oscillators]; // returns 0 to 2*PI
109};
110
111
112
113
114struct rgb {
115 float red, green, blue;
116};
117
118
119
120static const uint8_t PERLIN_NOISE[] = {
121 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7,
122 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190,
123 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117,
124 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136,
125 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158,
126 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46,
127 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209,
128 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86,
129 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5,
130 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16,
131 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44,
132 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253,
133 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97,
134 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51,
135 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184,
136 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93,
137 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156,
138 180};
139
140FASTLED_FORCE_INLINE uint8_t P(uint8_t x) {
141 const uint8_t idx = x & 255;
142 const uint8_t* ptr = PERLIN_NOISE + idx;
143 return *ptr;
144}
145
147
148 public:
149 int num_x; // how many LEDs are in one row?
150 int num_y; // how many rows?
151
152 float speed_factor = 1; // 0.1 to 10
153
154 float radial_filter_radius = 23.0; // on 32x32, use 11 for 16x16
155
156 bool serpentine;
157
158 render_parameters animation; // all animation parameters in one place
159 oscillators timings; // all speed settings in one place
160 modulators move; // all oscillator based movers and shifters at one place
161 rgb pixel;
162
163 std::vector<std::vector<float>>
164 polar_theta; // look-up table for polar angles
165 std::vector<std::vector<float>>
166 distance; // look-up table for polar distances
167
168 unsigned long a, b, c; // for time measurements
169
170 float show1, show2, show3, show4, show5, show6, show7, show8, show9, show0;
171
172 ANIMartRIX() {}
173
174 ANIMartRIX(int w, int h) { this->init(w, h); }
175
176 virtual ~ANIMartRIX() {}
177
178 virtual uint16_t xyMap(uint16_t x, uint16_t y) = 0;
179
180 uint32_t currentTime = 0;
181 void setTime(uint32_t t) { currentTime = t; }
182 uint32_t getTime() { return currentTime ? currentTime : millis(); }
183
184
185 void init(int w, int h) {
186 animation = render_parameters();
187 timings = oscillators();
188 move = modulators();
189 pixel = rgb();
190
191 this->num_x = w;
192 this->num_y = h;
193 if (w <= 16) {
194 this->radial_filter_radius = 11;
195 } else {
196 this->radial_filter_radius = 23; // on 32x32, use 11 for 16x16
197 }
198 render_polar_lookup_table(
199 (num_x / 2) - 0.5,
200 (num_y / 2) - 0.5); // precalculate all polar coordinates
201 // polar origin is set to matrix centre
202 }
203
209 void setSpeedFactor(float speed) { this->speed_factor = speed; }
210
211 // Dynamic darkening methods:
212
213 float subtract(float &a, float &b) { return a - b; }
214
215 float multiply(float &a, float &b) { return a * b / 255.f; }
216
217 // makes low brightness darker
218 // sets the black point high = more contrast
219 // animation.low_limit should be 0 for best results
220 float colorburn(float &a, float &b) {
221
222 return (1 - ((1 - a / 255.f) / (b / 255.f))) * 255.f;
223 }
224
225 // Dynamic brightening methods
226
227 float add(float &a, float &b) { return a + b; }
228
229 // makes bright even brighter
230 // reduces contrast
231 float screen(float &a, float &b) {
232
233 return (1 - (1 - a / 255.f) * (1 - b / 255.f)) * 255.f;
234 }
235
236 float colordodge(float &a, float &b) { return (a / (255.f - b)) * 255.f; }
237 /*
238 Ken Perlins improved noise - http://mrl.nyu.edu/~perlin/noise/
239 C-port: http://www.fundza.com/c4serious/noise/perlin/perlin.html
240 by Malcolm Kesson; arduino port by Peter Chiochetti, Sep 2007 :
241 - make permutation constant byte, obsoletes init(), lookup % 256
242 */
243
244 float fade(float t) { return t * t * t * (t * (t * 6 - 15) + 10); }
245 float lerp(float t, float a, float b) { return a + t * (b - a); }
246 float grad(int hash, float x, float y, float z) {
247 int h = hash & 15; /* CONVERT LO 4 BITS OF HASH CODE */
248 float u = h < 8 ? x : y, /* INTO 12 GRADIENT DIRECTIONS. */
249 v = h < 4 ? y
250 : h == 12 || h == 14 ? x
251 : z;
252 return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
253 }
254
255
256 float pnoise(float x, float y, float z) {
257
258 int X = (int)floorf(x) & 255, /* FIND UNIT CUBE THAT */
259 Y = (int)floorf(y) & 255, /* CONTAINS POINT. */
260 Z = (int)floorf(z) & 255;
261 x -= floorf(x); /* FIND RELATIVE X,Y,Z */
262 y -= floorf(y); /* OF POINT IN CUBE. */
263 z -= floorf(z);
264 float u = fade(x), /* COMPUTE FADE CURVES */
265 v = fade(y), /* FOR EACH OF X,Y,Z. */
266 w = fade(z);
267 int A = P(X) + Y, AA = P(A) + Z,
268 AB = P(A + 1) + Z, /* HASH COORDINATES OF */
269 B = P(X + 1) + Y, BA = P(B) + Z,
270 BB = P(B + 1) + Z; /* THE 8 CUBE CORNERS, */
271
272 return lerp(w,
273 lerp(v,
274 lerp(u, grad(P(AA), x, y, z), /* AND ADD */
275 grad(P(BA), x - 1, y, z)), /* BLENDED */
276 lerp(u, grad(P(AB), x, y - 1, z), /* RESULTS */
277 grad(P(BB), x - 1, y - 1, z))), /* FROM 8 */
278 lerp(v,
279 lerp(u, grad(P(AA + 1), x, y, z - 1), /* CORNERS */
280 grad(P(BA + 1), x - 1, y, z - 1)), /* OF CUBE */
281 lerp(u, grad(P(AB + 1), x, y - 1, z - 1),
282 grad(P(BB + 1), x - 1, y - 1, z - 1))));
283 }
284
285 void calculate_oscillators(oscillators &timings) {
286
287 double runtime = getTime() * timings.master_speed *
288 speed_factor; // global anaimation speed
289
290 for (int i = 0; i < num_oscillators; i++) {
291
292 move.linear[i] =
293 (runtime + timings.offset[i]) *
294 timings.ratio[i]; // continously rising offsets, returns 0 to
295 // max_float
296
297 move.radial[i] = fmodf(move.linear[i],
298 2 * PI); // angle offsets for continous
299 // rotation, returns 0 to 2 * PI
300
301 move.directional[i] =
302 sinf(move.radial[i]); // directional offsets or factors, returns
303 // -1 to 1
304
305 move.noise_angle[i] =
306 PI *
307 (1 +
308 pnoise(move.linear[i], 0,
309 0)); // noise based angle offset, returns 0 to 2 * PI
310 }
311 }
312
313 void run_default_oscillators() {
314
315 timings.master_speed = 0.005; // master speed
316
317 timings.ratio[0] = 1; // speed ratios for the oscillators, higher values
318 // = faster transitions
319 timings.ratio[1] = 2;
320 timings.ratio[2] = 3;
321 timings.ratio[3] = 4;
322 timings.ratio[4] = 5;
323 timings.ratio[5] = 6;
324 timings.ratio[6] = 7;
325 timings.ratio[7] = 8;
326 timings.ratio[8] = 9;
327 timings.ratio[9] = 10;
328
329 timings.offset[0] = 000;
330 timings.offset[1] = 100;
331 timings.offset[2] = 200;
332 timings.offset[3] = 300;
333 timings.offset[4] = 400;
334 timings.offset[5] = 500;
335 timings.offset[6] = 600;
336 timings.offset[7] = 700;
337 timings.offset[8] = 800;
338 timings.offset[9] = 900;
339
340 calculate_oscillators(timings);
341 }
342
343 // Convert the 2 polar coordinates back to cartesian ones & also apply all
344 // 3d transitions. Calculate the noise value at this point based on the 5
345 // dimensional manipulation of the underlaying coordinates.
346
347 float render_value(render_parameters &animation) {
348
349 // convert polar coordinates back to cartesian ones
350
351 float newx = (animation.offset_x + animation.center_x -
352 (cosf(animation.angle) * animation.dist)) *
353 animation.scale_x;
354 float newy = (animation.offset_y + animation.center_y -
355 (sinf(animation.angle) * animation.dist)) *
356 animation.scale_y;
357 float newz = (animation.offset_z + animation.z) * animation.scale_z;
358
359 // render noisevalue at this new cartesian point
360
361 float raw_noise_field_value = pnoise(newx, newy, newz);
362
363 // A) enhance histogram (improve contrast) by setting the black and
364 // white point (low & high_limit) B) scale the result to a 0-255 range
365 // (assuming you want 8 bit color depth per rgb chanel) Here happens the
366 // contrast boosting & the brightness mapping
367
368 if (raw_noise_field_value < animation.low_limit)
369 raw_noise_field_value = animation.low_limit;
370 if (raw_noise_field_value > animation.high_limit)
371 raw_noise_field_value = animation.high_limit;
372
373 float scaled_noise_value =
374 map_float(raw_noise_field_value, animation.low_limit,
375 animation.high_limit, 0, 255);
376
377 return scaled_noise_value;
378 }
379
380 // given a static polar origin we can precalculate
381 // the polar coordinates
382
383 void render_polar_lookup_table(float cx, float cy) {
384
385 polar_theta.resize(num_x, std::vector<float>(num_y, 0.0f));
386 distance.resize(num_x, std::vector<float>(num_y, 0.0f));
387
388 for (int xx = 0; xx < num_x; xx++) {
389 for (int yy = 0; yy < num_y; yy++) {
390
391 float dx = xx - cx;
392 float dy = yy - cy;
393
394 distance[xx][yy] = hypotf(dx, dy);
395 polar_theta[xx][yy] = atan2f(dy, dx);
396 }
397 }
398 }
399
400 // float mapping maintaining 32 bit precision
401 // we keep values with high resolution for potential later usage
402
403 float map_float(float x, float in_min, float in_max, float out_min,
404 float out_max) {
405
406 float result =
407 (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
408 if (result < out_min)
409 result = out_min;
410 if (result > out_max)
411 result = out_max;
412
413 return result;
414 }
415
416 /* unnecessary bloat
417
418 // check result after colormapping and store the newly rendered rgb data
419
420 void write_pixel_to_framebuffer(int x, int y, rgb &pixel) {
421
422 // assign the final color of this one pixel
423 CRGB finalcolor = CRGB(pixel.red, pixel.green, pixel.blue);
424
425 // write the rendered pixel into the framebutter
426 leds[xyMap(x, y)] = finalcolor;
427 }
428 */
429
430 // Avoid any possible color flicker by forcing the raw RGB values to be
431 // 0-255. This enables to play freely with random equations for the
432 // colormapping without causing flicker by accidentally missing the valid
433 // target range.
434
435 rgb rgb_sanity_check(rgb &pixel) {
436
437 // rescue data if possible, return absolute value
438 // if (pixel.red < 0) pixel.red = fabsf(pixel.red);
439 // if (pixel.green < 0) pixel.green = fabsf(pixel.green);
440 // if (pixel.blue < 0) pixel.blue = fabsf(pixel.blue);
441
442 // Can never be negative colour
443 if (pixel.red < 0)
444 pixel.red = 0;
445 if (pixel.green < 0)
446 pixel.green = 0;
447 if (pixel.blue < 0)
448 pixel.blue = 0;
449
450 // discard everything above the valid 8 bit colordepth 0-255 range
451 if (pixel.red > 255)
452 pixel.red = 255;
453 if (pixel.green > 255)
454 pixel.green = 255;
455 if (pixel.blue > 255)
456 pixel.blue = 255;
457
458 return pixel;
459 }
460
461 // find the right led index according to you LED matrix wiring
462
463 void get_ready() { // wait until new buffer is ready, measure time
464 a = micros();
465 logOutput();
466 }
467
468 virtual void setPixelColorInternal(int x, int y, rgb pixel) = 0;
469
470 // virtual void setPixelColorInternal(int index, rgb pixel) = 0;
471
472 void logOutput() { b = micros(); }
473
474 void logFrame() { c = micros(); }
475
476 // Show the current framerate, rendered pixels per second,
477 // rendering time & time spend to push the data to the leds.
478 // in the serial monitor.
479
480 void report_performance() {
481
482 float calc = b - a; // waiting time
483 float push = c - b; // rendering time
484 float total = c - a; // time per frame
485 int fps = 1000000 / total; // frames per second
486 int kpps = (fps * num_x * num_y) / 1000; // kilopixel per second
487
488 ANIMARTRIX_PRINT(fps);
489 ANIMARTRIX_PRINT(" fps ");
490 ANIMARTRIX_PRINT(kpps);
491 ANIMARTRIX_PRINT(" kpps @");
492 ANIMARTRIX_PRINT(num_x * num_y);
493 ANIMARTRIX_PRINT(" LEDs ");
494 ANIMARTRIX_PRINT(round(total));
495 ANIMARTRIX_PRINT(" µs per frame waiting: ");
496 ANIMARTRIX_PRINT(round((calc * 100) / total));
497 ANIMARTRIX_PRINT("% rendering: ");
498 ANIMARTRIX_PRINT(round((push * 100) / total));
499 ANIMARTRIX_PRINT("% (");
500 ANIMARTRIX_PRINT(round(calc));
501 ANIMARTRIX_PRINT(" + ");
502 ANIMARTRIX_PRINT(round(push));
503 ANIMARTRIX_PRINT(" µs) Core-temp: ");
504 // TODO ANIMARTRIX_PRINT( tempmonGetTemp() );
505 //Serial.println(" °C");
506 ANIMARTRIX_PRINT(" °C\n");
507 }
508
509 // Effects
510
511 void Rotating_Blob() {
512
513 get_ready();
514
515 timings.master_speed = 0.01; // speed ratios for the oscillators
516 timings.ratio[0] = 0.1; // higher values = faster transitions
517 timings.ratio[1] = 0.03;
518 timings.ratio[2] = 0.03;
519 timings.ratio[3] = 0.03;
520
521 timings.offset[1] = 10;
522 timings.offset[2] = 20;
523 timings.offset[3] = 30;
524
525 calculate_oscillators(
526 timings); // get linear movers and oscillators going
527
528 for (int x = 0; x < num_x; x++) {
529 for (int y = 0; y < num_y; y++) {
530
531 // describe and render animation layers
532 animation.scale_x = 0.05;
533 animation.scale_y = 0.05;
534 animation.offset_x = 0;
535 animation.offset_y = 0;
536 animation.offset_z = 100;
537 animation.angle = polar_theta[x][y] + move.radial[0];
538 animation.dist = distance[x][y];
539 animation.z = move.linear[0];
540 animation.low_limit = -1;
541 float show1 = render_value(animation);
542
543 animation.angle =
544 polar_theta[x][y] - move.radial[1] + show1 / 512.0;
545 animation.dist = distance[x][y] * show1 / 255.0;
546 animation.low_limit = 0;
547 animation.z = move.linear[1];
548 float show2 = render_value(animation);
549
550 animation.angle =
551 polar_theta[x][y] - move.radial[2] + show1 / 512.0;
552 animation.dist = distance[x][y] * show1 / 220.0;
553 animation.z = move.linear[2];
554 float show3 = render_value(animation);
555
556 animation.angle =
557 polar_theta[x][y] - move.radial[3] + show1 / 512.0;
558 animation.dist = distance[x][y] * show1 / 200.0;
559 animation.z = move.linear[3];
560 float show4 = render_value(animation);
561
562 // colormapping
563 pixel.red = (show2 + show4) / 2;
564 pixel.green = show3 / 6;
565 pixel.blue = 0;
566
567 pixel = rgb_sanity_check(pixel);
568
569 setPixelColorInternal(x, y, pixel);
570 }
571 }
572 }
573
574 void Chasing_Spirals() {
575
576 get_ready();
577
578 timings.master_speed = 0.01; // speed ratios for the oscillators
579 timings.ratio[0] = 0.1; // higher values = faster transitions
580 timings.ratio[1] = 0.13;
581 timings.ratio[2] = 0.16;
582
583 timings.offset[1] = 10;
584 timings.offset[2] = 20;
585 timings.offset[3] = 30;
586
587 calculate_oscillators(
588 timings); // get linear movers and oscillators going
589
590 for (int x = 0; x < num_x; x++) {
591 for (int y = 0; y < num_y; y++) {
592
593 // describe and render animation layers
594 animation.angle =
595 3 * polar_theta[x][y] + move.radial[0] - distance[x][y] / 3;
596 animation.dist = distance[x][y];
597 animation.scale_z = 0.1;
598 animation.scale_y = 0.1;
599 animation.scale_x = 0.1;
600 animation.offset_x = move.linear[0];
601 animation.offset_y = 0;
602 animation.offset_z = 0;
603 animation.z = 0;
604 float show1 = render_value(animation);
605
606 animation.angle =
607 3 * polar_theta[x][y] + move.radial[1] - distance[x][y] / 3;
608 animation.dist = distance[x][y];
609 animation.offset_x = move.linear[1];
610 float show2 = render_value(animation);
611
612 animation.angle =
613 3 * polar_theta[x][y] + move.radial[2] - distance[x][y] / 3;
614 animation.dist = distance[x][y];
615 animation.offset_x = move.linear[2];
616 float show3 = render_value(animation);
617
618 // colormapping
619 float radius = radial_filter_radius;
620 float radial_filter = (radius - distance[x][y]) / radius;
621
622 pixel.red = 3 * show1 * radial_filter;
623 pixel.green = show2 * radial_filter / 2;
624 pixel.blue = show3 * radial_filter / 4;
625
626 pixel = rgb_sanity_check(pixel);
627
628 setPixelColorInternal(x, y, pixel);
629 }
630 }
631 }
632
633 void Rings() {
634
635 get_ready();
636
637 timings.master_speed = 0.01; // speed ratios for the oscillators
638 timings.ratio[0] = 1; // higher values = faster transitions
639 timings.ratio[1] = 1.1;
640 timings.ratio[2] = 1.2;
641
642 timings.offset[1] = 100;
643 timings.offset[2] = 200;
644 timings.offset[3] = 300;
645
646 calculate_oscillators(
647 timings); // get linear movers and oscillators going
648
649 for (int x = 0; x < num_x; x++) {
650 for (int y = 0; y < num_y; y++) {
651
652 // describe and render animation layers
653 animation.angle = 5;
654 animation.scale_x = 0.2;
655 animation.scale_y = 0.2;
656 animation.scale_z = 1;
657 animation.dist = distance[x][y];
658 animation.offset_y = -move.linear[0];
659 animation.offset_x = 0;
660 float show1 = render_value(animation);
661
662 // describe and render animation layers
663 animation.angle = 10;
664
665 animation.dist = distance[x][y];
666 animation.offset_y = -move.linear[1];
667 float show2 = render_value(animation);
668
669 // describe and render animation layers
670 animation.angle = 12;
671
672 animation.dist = distance[x][y];
673 animation.offset_y = -move.linear[2];
674 float show3 = render_value(animation);
675
676 // colormapping
677 pixel.red = show1;
678 pixel.green = show2 / 4;
679 pixel.blue = show3 / 4;
680
681 pixel = rgb_sanity_check(pixel);
682
683 setPixelColorInternal(x, y, pixel);
684 }
685 }
686 }
687
688 void Waves() {
689
690 get_ready();
691
692 timings.master_speed = 0.01; // speed ratios for the oscillators
693 timings.ratio[0] = 2; // higher values = faster transitions
694 timings.ratio[1] = 2.1;
695 timings.ratio[2] = 1.2;
696
697 timings.offset[1] = 100;
698 timings.offset[2] = 200;
699 timings.offset[3] = 300;
700
701 calculate_oscillators(
702 timings); // get linear movers and oscillators going
703
704 for (int x = 0; x < num_x; x++) {
705 for (int y = 0; y < num_y; y++) {
706
707 // describe and render animation layers
708 animation.angle = polar_theta[x][y];
709 animation.scale_x = 0.1;
710 animation.scale_y = 0.1;
711 animation.scale_z = 0.1;
712 animation.dist = distance[x][y];
713 animation.offset_y = 0;
714 animation.offset_x = 0;
715 animation.z = 2 * distance[x][y] - move.linear[0];
716 float show1 = render_value(animation);
717
718 animation.angle = polar_theta[x][y];
719 animation.dist = distance[x][y];
720 animation.z = 2 * distance[x][y] - move.linear[1];
721 float show2 = render_value(animation);
722
723 // colormapping
724 pixel.red = show1;
725 pixel.green = 0;
726 pixel.blue = show2;
727
728 pixel = rgb_sanity_check(pixel);
729
730 setPixelColorInternal(x, y, pixel);
731 }
732 }
733 }
734
735 void Center_Field() {
736
737 get_ready();
738
739 timings.master_speed = 0.01; // speed ratios for the oscillators
740 timings.ratio[0] = 1; // higher values = faster transitions
741 timings.ratio[1] = 1.1;
742 timings.ratio[2] = 1.2;
743
744 timings.offset[1] = 100;
745 timings.offset[2] = 200;
746 timings.offset[3] = 300;
747
748 calculate_oscillators(
749 timings); // get linear movers and oscillators going
750
751 for (int x = 0; x < num_x; x++) {
752 for (int y = 0; y < num_y; y++) {
753
754 // describe and render animation layers
755 animation.angle = polar_theta[x][y];
756 animation.scale_x = 0.07;
757 animation.scale_y = 0.07;
758 animation.scale_z = 0.1;
759 animation.dist = 5 * sqrtf(distance[x][y]);
760 animation.offset_y = move.linear[0];
761 animation.offset_x = 0;
762 animation.z = 0;
763 float show1 = render_value(animation);
764
765 animation.angle = polar_theta[x][y];
766 animation.scale_x = 0.07;
767 animation.scale_y = 0.07;
768 animation.scale_z = 0.1;
769 animation.dist = 4 * sqrtf(distance[x][y]);
770 animation.offset_y = move.linear[0];
771 animation.offset_x = 0;
772 animation.z = 0;
773 float show2 = render_value(animation);
774
775 // colormapping
776 pixel.red = show1;
777 pixel.green = show2;
778 pixel.blue = 0;
779
780 pixel = rgb_sanity_check(pixel);
781
782 setPixelColorInternal(x, y, pixel);
783 }
784 }
785 }
786
787 void Distance_Experiment() {
788
789 get_ready();
790
791 timings.master_speed = 0.01; // speed ratios for the oscillators
792 timings.ratio[0] = 0.2; // higher values = faster transitions
793 timings.ratio[1] = 0.13;
794 timings.ratio[2] = 0.012;
795
796 timings.offset[1] = 100;
797 timings.offset[2] = 200;
798 timings.offset[3] = 300;
799
800 calculate_oscillators(
801 timings); // get linear movers and oscillators going
802
803 for (int x = 0; x < num_x; x++) {
804 for (int y = 0; y < num_y; y++) {
805
806 // describe and render animation layers
807 animation.dist = powf(distance[x][y], 0.5);
808 animation.angle = polar_theta[x][y] + move.radial[0];
809 animation.scale_x = 0.07;
810 animation.scale_y = 0.07;
811 animation.scale_z = 0.1;
812 animation.offset_y = move.linear[0];
813 animation.offset_x = 0;
814 animation.offset_z = 0;
815 animation.z = 0;
816 float show1 = render_value(animation);
817
818 animation.dist = powf(distance[x][y], 0.6);
819 animation.angle = polar_theta[x][y] + move.noise_angle[2];
820 animation.scale_x = 0.07;
821 animation.scale_y = 0.07;
822 animation.scale_z = 0.1;
823 animation.offset_y = move.linear[1];
824 animation.offset_x = 0;
825 animation.offset_z = 0;
826 animation.z = 0;
827 float show2 = render_value(animation);
828
829 // colormapping
830 pixel.red = show1 + show2;
831 pixel.green = show2;
832 pixel.blue = 0;
833
834 pixel = rgb_sanity_check(pixel);
835
836 setPixelColorInternal(x, y, pixel);
837 }
838 }
839 }
840
841 void Caleido1() {
842
843 get_ready();
844
845 timings.master_speed = 0.003; // speed ratios for the oscillators
846 timings.ratio[0] = 0.02; // higher values = faster transitions
847 timings.ratio[1] = 0.03;
848 timings.ratio[2] = 0.04;
849 timings.ratio[3] = 0.05;
850 timings.ratio[4] = 0.6;
851 timings.offset[0] = 0;
852 timings.offset[1] = 100;
853 timings.offset[2] = 200;
854 timings.offset[3] = 300;
855 timings.offset[4] = 400;
856
857 calculate_oscillators(
858 timings); // get linear movers and oscillators going
859
860 for (int x = 0; x < num_x; x++) {
861 for (int y = 0; y < num_y; y++) {
862
863 // describe and render animation layers
864 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
865 animation.angle = 3 * polar_theta[x][y] +
866 3 * move.noise_angle[0] + move.radial[4];
867 animation.scale_x = 0.1;
868 animation.scale_y = 0.1;
869 animation.scale_z = 0.1;
870 animation.offset_y = 2 * move.linear[0];
871 animation.offset_x = 0;
872 animation.offset_z = 0;
873 animation.z = move.linear[0];
874 float show1 = render_value(animation);
875
876 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
877 animation.angle = 4 * polar_theta[x][y] +
878 3 * move.noise_angle[1] + move.radial[4];
879 animation.offset_x = 2 * move.linear[1];
880 animation.z = move.linear[1];
881 float show2 = render_value(animation);
882
883 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
884 animation.angle = 5 * polar_theta[x][y] +
885 3 * move.noise_angle[2] + move.radial[4];
886 animation.offset_y = 2 * move.linear[2];
887 animation.z = move.linear[2];
888 float show3 = render_value(animation);
889
890 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
891 animation.angle = 4 * polar_theta[x][y] +
892 3 * move.noise_angle[3] + move.radial[4];
893 animation.offset_x = 2 * move.linear[3];
894 animation.z = move.linear[3];
895 float show4 = render_value(animation);
896
897 // colormapping
898 pixel.red = show1;
899 pixel.green = show3 * distance[x][y] / 10;
900 pixel.blue = (show2 + show4) / 2;
901
902 pixel = rgb_sanity_check(pixel);
903
904 setPixelColorInternal(x, y, pixel);
905 }
906 }
907 }
908
909 void Caleido2() {
910
911 get_ready();
912
913 timings.master_speed = 0.002; // speed ratios for the oscillators
914 timings.ratio[0] = 0.02; // higher values = faster transitions
915 timings.ratio[1] = 0.03;
916 timings.ratio[2] = 0.04;
917 timings.ratio[3] = 0.05;
918 timings.ratio[4] = 0.6;
919 timings.offset[0] = 0;
920 timings.offset[1] = 100;
921 timings.offset[2] = 200;
922 timings.offset[3] = 300;
923 timings.offset[4] = 400;
924
925 calculate_oscillators(
926 timings); // get linear movers and oscillators going
927
928 for (int x = 0; x < num_x; x++) {
929 for (int y = 0; y < num_y; y++) {
930
931 // describe and render animation layers
932 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
933 animation.angle = 2 * polar_theta[x][y] +
934 3 * move.noise_angle[0] + move.radial[4];
935 animation.scale_x = 0.1;
936 animation.scale_y = 0.1;
937 animation.scale_z = 0.1;
938 animation.offset_y = 2 * move.linear[0];
939 animation.offset_x = 0;
940 animation.offset_z = 0;
941 animation.z = move.linear[0];
942 float show1 = render_value(animation);
943
944 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
945 animation.angle = 2 * polar_theta[x][y] +
946 3 * move.noise_angle[1] + move.radial[4];
947 animation.offset_x = 2 * move.linear[1];
948 animation.z = move.linear[1];
949 float show2 = render_value(animation);
950
951 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
952 animation.angle = 2 * polar_theta[x][y] +
953 3 * move.noise_angle[2] + move.radial[4];
954 animation.offset_y = 2 * move.linear[2];
955 animation.z = move.linear[2];
956 float show3 = render_value(animation);
957
958 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
959 animation.angle = 2 * polar_theta[x][y] +
960 3 * move.noise_angle[3] + move.radial[4];
961 animation.offset_x = 2 * move.linear[3];
962 animation.z = move.linear[3];
963 float show4 = render_value(animation);
964
965 // colormapping
966 pixel.red = show1;
967 pixel.green = show3 * distance[x][y] / 10;
968 pixel.blue = (show2 + show4) / 2;
969
970 pixel = rgb_sanity_check(pixel);
971
972 setPixelColorInternal(x, y, pixel);
973 }
974 }
975 }
976
977 void Caleido3() {
978
979 get_ready();
980
981 timings.master_speed = 0.004; // speed ratios for the oscillators
982 timings.ratio[0] = 0.02; // higher values = faster transitions
983 timings.ratio[1] = 0.03;
984 timings.ratio[2] = 0.04;
985 timings.ratio[3] = 0.05;
986 timings.ratio[4] = 0.6;
987 timings.offset[0] = 0;
988 timings.offset[1] = 100;
989 timings.offset[2] = 200;
990 timings.offset[3] = 300;
991 timings.offset[4] = 400;
992
993 calculate_oscillators(
994 timings); // get linear movers and oscillators going
995
996 for (int x = 0; x < num_x; x++) {
997 for (int y = 0; y < num_y; y++) {
998
999 // describe and render animation layers
1000 animation.dist = distance[x][y] * (2 + move.directional[0]) / 3;
1001 animation.angle = 2 * polar_theta[x][y] +
1002 3 * move.noise_angle[0] + move.radial[4];
1003 animation.scale_x = 0.1; // + (move.directional[0] + 2)/100;
1004 animation.scale_y = 0.1; // + (move.directional[1] + 2)/100;
1005 animation.scale_z = 0.1;
1006 animation.offset_y = 2 * move.linear[0];
1007 animation.offset_x = 2 * move.linear[1];
1008 animation.offset_z = 0;
1009 animation.z = move.linear[0];
1010 float show1 = render_value(animation);
1011
1012 animation.dist = distance[x][y] * (2 + move.directional[1]) / 3;
1013 animation.angle = 2 * polar_theta[x][y] +
1014 3 * move.noise_angle[1] + move.radial[4];
1015 animation.offset_x = 2 * move.linear[1];
1016 animation.offset_y = show1 / 20.0;
1017 animation.z = move.linear[1];
1018 float show2 = render_value(animation);
1019
1020 animation.dist = distance[x][y] * (2 + move.directional[2]) / 3;
1021 animation.angle = 2 * polar_theta[x][y] +
1022 3 * move.noise_angle[2] + move.radial[4];
1023 animation.offset_y = 2 * move.linear[2];
1024 animation.offset_x = show2 / 20.0;
1025 animation.z = move.linear[2];
1026 float show3 = render_value(animation);
1027
1028 animation.dist = distance[x][y] * (2 + move.directional[3]) / 3;
1029 animation.angle = 2 * polar_theta[x][y] +
1030 3 * move.noise_angle[3] + move.radial[4];
1031 animation.offset_x = 2 * move.linear[3];
1032 animation.offset_y = show3 / 20.0;
1033 animation.z = move.linear[3];
1034 float show4 = render_value(animation);
1035
1036 // colormapping
1037 float radius = radial_filter_radius; // radial mask
1038
1039 pixel.red = show1 * (y + 1) / num_y;
1040 pixel.green = show3 * distance[x][y] / 10;
1041 pixel.blue = (show2 + show4) / 2;
1042 if (distance[x][y] > radius) {
1043 pixel.red = 0;
1044 pixel.green = 0;
1045 pixel.blue = 0;
1046 }
1047
1048 pixel = rgb_sanity_check(pixel);
1049
1050 setPixelColorInternal(x, y, pixel);
1051 }
1052 }
1053 }
1054
1055 void Lava1() {
1056
1057 get_ready();
1058
1059 timings.master_speed = 0.0015; // speed ratios for the oscillators
1060 timings.ratio[0] = 4; // higher values = faster transitions
1061 timings.ratio[1] = 1;
1062 timings.ratio[2] = 1;
1063 timings.ratio[3] = 0.05;
1064 timings.ratio[4] = 0.6;
1065 timings.offset[0] = 0;
1066 timings.offset[1] = 100;
1067 timings.offset[2] = 200;
1068 timings.offset[3] = 300;
1069 timings.offset[4] = 400;
1070
1071 calculate_oscillators(
1072 timings); // get linear movers and oscillators going
1073
1074 for (int x = 0; x < num_x; x++) {
1075 for (int y = 0; y < num_y; y++) {
1076
1077 // describe and render animation layers
1078 animation.dist = distance[x][y] * 0.8;
1079 animation.angle = polar_theta[x][y];
1080 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1081 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1082 animation.scale_z = 0.01;
1083 animation.offset_y = -move.linear[0];
1084 animation.offset_x = 0;
1085 animation.offset_z = 0;
1086 animation.z = 30;
1087 float show1 = render_value(animation);
1088
1089 animation.offset_y = -move.linear[1];
1090 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1091 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1092 animation.offset_x = show1 / 100;
1093 animation.offset_y += show1 / 100;
1094
1095 float show2 = render_value(animation);
1096
1097 animation.offset_y = -move.linear[2];
1098 animation.scale_x = 0.15; // + (move.directional[0] + 2)/100;
1099 animation.scale_y = 0.12; // + (move.directional[1] + 2)/100;
1100 animation.offset_x = show2 / 100;
1101 animation.offset_y += show2 / 100;
1102
1103 float show3 = render_value(animation);
1104
1105 // colormapping
1106 float linear = (y) / (num_y - 1.f); // radial mask
1107
1108 pixel.red = linear * show2;
1109 pixel.green = 0.1 * linear * (show2 - show3);
1110 pixel.blue = 0;
1111
1112 pixel = rgb_sanity_check(pixel);
1113
1114 setPixelColorInternal(x, y, pixel);
1115 }
1116 }
1117 }
1118
1119 void Scaledemo1() {
1120
1121 get_ready();
1122
1123 timings.master_speed = 0.000001; // speed ratios for the oscillators
1124 timings.ratio[0] = 4; // higher values = faster transitions
1125 timings.ratio[1] = 3.2;
1126 timings.ratio[2] = 10;
1127 timings.ratio[3] = 0.05;
1128 timings.ratio[4] = 0.6;
1129 timings.offset[0] = 0;
1130 timings.offset[1] = 100;
1131 timings.offset[2] = 200;
1132 timings.offset[3] = 300;
1133 timings.offset[4] = 400;
1134
1135 calculate_oscillators(
1136 timings); // get linear movers and oscillators going
1137
1138 for (int x = 0; x < num_x; x++) {
1139 for (int y = 0; y < num_y; y++) {
1140
1141 // describe and render animation layers
1142 animation.dist = 0.3 * distance[x][y] * 0.8;
1143 animation.angle = 3 * polar_theta[x][y] + move.radial[2];
1144 animation.scale_x = 0.1 + (move.noise_angle[0]) / 10;
1145 animation.scale_y =
1146 0.1 + (move.noise_angle[1]) /
1147 10; // + (move.directional[1] + 2)/100;
1148 animation.scale_z = 0.01;
1149 animation.offset_y = 0;
1150 animation.offset_x = 0;
1151 animation.offset_z = 100 * move.linear[0];
1152 animation.z = 30;
1153 float show1 = render_value(animation);
1154
1155 animation.angle = 3;
1156 float show2 = render_value(animation);
1157
1158 float dist = 1; //(10-distance[x][y])/ 10;
1159 pixel.red = show1 * dist;
1160 pixel.green = (show1 - show2) * dist * 0.3;
1161 pixel.blue = (show2 - show1) * dist;
1162
1163 if (distance[x][y] > 16) {
1164 pixel.red = 0;
1165 pixel.green = 0;
1166 pixel.blue = 0;
1167 }
1168
1169 pixel = rgb_sanity_check(pixel);
1170
1171 setPixelColorInternal(y, x, pixel);
1172 }
1173 }
1174 }
1175
1176 void Yves() {
1177
1178 get_ready();
1179
1180 a = micros(); // for time measurement in report_performance()
1181
1182 timings.master_speed = 0.001; // speed ratios for the oscillators
1183 timings.ratio[0] = 3; // higher values = faster transitions
1184 timings.ratio[1] = 2;
1185 timings.ratio[2] = 1;
1186 timings.ratio[3] = 0.13;
1187 timings.ratio[4] = 0.15;
1188 timings.ratio[5] = 0.03;
1189 timings.ratio[6] = 0.025;
1190 timings.offset[0] = 0;
1191 timings.offset[1] = 100;
1192 timings.offset[2] = 200;
1193 timings.offset[3] = 300;
1194 timings.offset[4] = 400;
1195 timings.offset[5] = 500;
1196 timings.offset[6] = 600;
1197
1198 calculate_oscillators(
1199 timings); // get linear movers and oscillators going
1200
1201 for (int x = 0; x < num_x; x++) {
1202 for (int y = 0; y < num_y; y++) {
1203
1204 animation.dist = distance[x][y];
1205 animation.angle =
1206 polar_theta[x][y] + 2 * PI + move.noise_angle[5];
1207 animation.scale_x = 0.08;
1208 animation.scale_y = 0.08;
1209 animation.scale_z = 0.08;
1210 animation.offset_y = -move.linear[0];
1211 animation.offset_x = 0;
1212 animation.offset_z = 0;
1213 animation.z = 0;
1214 float show1 = render_value(animation);
1215
1216 animation.dist = distance[x][y];
1217 animation.angle =
1218 polar_theta[x][y] + 2 * PI + move.noise_angle[6];
1219 ;
1220 animation.scale_x = 0.08;
1221 animation.scale_y = 0.08;
1222 animation.scale_z = 0.08;
1223 animation.offset_y = -move.linear[1];
1224 animation.offset_x = 0;
1225 animation.offset_z = 0;
1226 animation.z = 0;
1227 float show2 = render_value(animation);
1228
1229 animation.angle = polar_theta[x][y] + show1 / 100 +
1230 move.noise_angle[3] + move.noise_angle[4];
1231 animation.dist = distance[x][y] + show2 / 50;
1232 animation.offset_y = -move.linear[2];
1233
1234 animation.offset_y += show1 / 100;
1235 animation.offset_x += show2 / 100;
1236
1237 float show3 = render_value(animation);
1238
1239 animation.offset_y = 0;
1240 animation.offset_x = 0;
1241
1242 float show4 = render_value(animation);
1243
1244 pixel.red = show3;
1245 pixel.green = show3 * show4 / 255;
1246 pixel.blue = 0;
1247
1248 pixel = rgb_sanity_check(pixel);
1249 setPixelColorInternal(y, x, pixel);
1250 }
1251 }
1252 }
1253
1254 void Spiralus() {
1255
1256 get_ready();
1257
1258 timings.master_speed = 0.0011; // speed ratios for the oscillators
1259 timings.ratio[0] = 1.5; // higher values = faster transitions
1260 timings.ratio[1] = 2.3;
1261 timings.ratio[2] = 3;
1262 timings.ratio[3] = 0.05;
1263 timings.ratio[4] = 0.2;
1264 timings.ratio[5] = 0.03;
1265 timings.ratio[6] = 0.025;
1266 timings.ratio[7] = 0.021;
1267 timings.ratio[8] = 0.027;
1268 timings.offset[0] = 0;
1269 timings.offset[1] = 100;
1270 timings.offset[2] = 200;
1271 timings.offset[3] = 300;
1272 timings.offset[4] = 400;
1273 timings.offset[5] = 500;
1274 timings.offset[6] = 600;
1275
1276 calculate_oscillators(
1277 timings); // get linear movers and oscillators going
1278
1279 for (int x = 0; x < num_x; x++) {
1280 for (int y = 0; y < num_y; y++) {
1281
1282 animation.dist = distance[x][y];
1283 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[5] +
1284 move.directional[3] * move.noise_angle[6] *
1285 animation.dist / 10;
1286 animation.scale_x = 0.08;
1287 animation.scale_y = 0.08;
1288 animation.scale_z = 0.02;
1289 animation.offset_y = -move.linear[0];
1290 animation.offset_x = 0;
1291 animation.offset_z = 0;
1292 animation.z = move.linear[1];
1293 float show1 = render_value(animation);
1294
1295 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[7] +
1296 move.directional[5] * move.noise_angle[8] *
1297 animation.dist / 10;
1298 animation.offset_y = -move.linear[1];
1299 animation.z = move.linear[2];
1300
1301 float show2 = render_value(animation);
1302
1303 animation.angle = 2 * polar_theta[x][y] + move.noise_angle[6] +
1304 move.directional[6] * move.noise_angle[7] *
1305 animation.dist / 10;
1306 animation.offset_y = move.linear[2];
1307 animation.z = move.linear[0];
1308 float show3 = render_value(animation);
1309
1310 float f = 1;
1311
1312 pixel.red = f * (show1 + show2);
1313 pixel.green = f * (show1 - show2);
1314 pixel.blue = f * (show3 - show1);
1315
1316 pixel = rgb_sanity_check(pixel);
1317 setPixelColorInternal(x, y, pixel);
1318 }
1319 }
1320 }
1321
1322 void Spiralus2() {
1323
1324 get_ready();
1325
1326 timings.master_speed = 0.0015; // speed ratios for the oscillators
1327 timings.ratio[0] = 1.5; // higher values = faster transitions
1328 timings.ratio[1] = 2.3;
1329 timings.ratio[2] = 3;
1330 timings.ratio[3] = 0.05;
1331 timings.ratio[4] = 0.2;
1332 timings.ratio[5] = 0.05;
1333 timings.ratio[6] = 0.055;
1334 timings.ratio[7] = 0.06;
1335 timings.ratio[8] = 0.027;
1336 timings.offset[0] = 0;
1337 timings.offset[1] = 100;
1338 timings.offset[2] = 200;
1339 timings.offset[3] = 300;
1340 timings.offset[4] = 400;
1341 timings.offset[5] = 500;
1342 timings.offset[6] = 600;
1343
1344 calculate_oscillators(
1345 timings); // get linear movers and oscillators going
1346
1347 for (int x = 0; x < num_x; x++) {
1348 for (int y = 0; y < num_y; y++) {
1349
1350 animation.dist = distance[x][y];
1351 animation.angle = 5 * polar_theta[x][y] + move.noise_angle[5] +
1352 move.directional[3] * move.noise_angle[6] *
1353 animation.dist / 10;
1354 animation.scale_x = 0.08;
1355 animation.scale_y = 0.08;
1356 animation.scale_z = 0.02;
1357 animation.offset_y = -move.linear[0];
1358 animation.offset_x = 0;
1359 animation.offset_z = 0;
1360 animation.z = move.linear[1];
1361 float show1 = render_value(animation);
1362
1363 animation.angle = 6 * polar_theta[x][y] + move.noise_angle[7] +
1364 move.directional[5] * move.noise_angle[8] *
1365 animation.dist / 10;
1366 animation.offset_y = -move.linear[1];
1367 animation.z = move.linear[2];
1368
1369 float show2 = render_value(animation);
1370
1371 animation.angle = 6 * polar_theta[x][y] + move.noise_angle[6] +
1372 move.directional[6] * move.noise_angle[7] *
1373 animation.dist / 10;
1374 animation.offset_y = move.linear[2];
1375 animation.z = move.linear[0];
1376 animation.dist = distance[x][y] * 0.8;
1377 float show3 = render_value(animation);
1378
1379 float f = 1; //(24-distance[x][y])/24;
1380
1381 pixel.red = f * (show1 + show2);
1382 pixel.green = f * (show1 - show2);
1383 pixel.blue = f * (show3 - show1);
1384
1385 pixel = rgb_sanity_check(pixel);
1386 setPixelColorInternal(y, x, pixel);
1387 }
1388 }
1389 }
1390
1391 void Hot_Blob() { // nice one
1392
1393 get_ready();
1394
1395 run_default_oscillators();
1396
1397 for (int x = 0; x < num_x; x++) {
1398 for (int y = 0; y < num_y; y++) {
1399
1400 animation.dist = distance[x][y];
1401 animation.angle = polar_theta[x][y];
1402
1403 animation.scale_x = 0.07 + move.directional[0] * 0.002;
1404 animation.scale_y = 0.07;
1405
1406 animation.offset_y = -move.linear[0];
1407 animation.offset_x = 0;
1408 animation.offset_z = 0;
1409
1410 animation.z = 0;
1411 animation.low_limit = -1;
1412 float show1 = render_value(animation);
1413
1414 animation.offset_y = -move.linear[1];
1415 float show3 = render_value(animation);
1416
1417 animation.offset_x = show3 / 20;
1418 animation.offset_y = -move.linear[0] / 2 + show1 / 70;
1419 animation.low_limit = 0;
1420 float show2 = render_value(animation);
1421
1422 animation.offset_x = show3 / 20;
1423 animation.offset_y = -move.linear[0] / 2 + show1 / 70;
1424 animation.z = 100;
1425 float show4 = render_value(animation);
1426
1427 float radius = radial_filter_radius; // radius of a radial
1428 // brightness filter
1429 float radial = (radius - animation.dist) / animation.dist;
1430
1431 float linear = (y + 1) / (num_y - 1.f);
1432
1433 pixel.red = radial * show2;
1434 pixel.green = linear * radial * 0.3 * (show2 - show4);
1435 pixel.blue = 0;
1436
1437 pixel = rgb_sanity_check(pixel);
1438 setPixelColorInternal(x, y, pixel);
1439 }
1440 }
1441 }
1442
1443 void Zoom() { // nice one
1444
1445 get_ready();
1446
1447 run_default_oscillators();
1448 timings.master_speed = 0.003;
1449 calculate_oscillators(timings);
1450
1451 for (int x = 0; x < num_x; x++) {
1452 for (int y = 0; y < num_y; y++) {
1453
1454 animation.dist = (distance[x][y] * distance[x][y]) / 2;
1455 animation.angle = polar_theta[x][y];
1456
1457 animation.scale_x = 0.005;
1458 animation.scale_y = 0.005;
1459
1460 animation.offset_y = -10 * move.linear[0];
1461 animation.offset_x = 0;
1462 animation.offset_z = 0;
1463
1464 animation.z = 0;
1465 animation.low_limit = 0;
1466 float show1 = render_value(animation);
1467
1468 float linear = 1; //(y+1)/(num_y-1.f);
1469
1470 pixel.red = show1 * linear;
1471 pixel.green = 0;
1472 pixel.blue = 0;
1473
1474 pixel = rgb_sanity_check(pixel);
1475 setPixelColorInternal(y, x, pixel);
1476 }
1477 }
1478 }
1479
1480 void Slow_Fade() { // nice one
1481
1482 get_ready();
1483
1484 run_default_oscillators();
1485 timings.master_speed = 0.00005;
1486 calculate_oscillators(timings);
1487
1488 for (int x = 0; x < num_x; x++) {
1489 for (int y = 0; y < num_y; y++) {
1490
1491 animation.dist =
1492 sqrtf(distance[x][y]) * 0.7 * (move.directional[0] + 1.5);
1493 animation.angle =
1494 polar_theta[x][y] - move.radial[0] + distance[x][y] / 5;
1495
1496 animation.scale_x = 0.11;
1497 animation.scale_y = 0.11;
1498
1499 animation.offset_y = -50 * move.linear[0];
1500 animation.offset_x = 0;
1501 animation.offset_z = 0;
1502
1503 animation.z = move.linear[0];
1504 animation.low_limit = -0.1;
1505 animation.high_limit = 1;
1506 float show1 = render_value(animation);
1507
1508 animation.dist = animation.dist * 1.1;
1509 animation.angle += move.noise_angle[0] / 10;
1510 float show2 = render_value(animation);
1511
1512 animation.dist = animation.dist * 1.1;
1513 animation.angle += move.noise_angle[1] / 10;
1514
1515 float show3 = render_value(animation);
1516
1517 float radius = radial_filter_radius; // radius of a radial
1518 // brightness filter
1519 float radial = (radius - distance[x][y]) / distance[x][y];
1520
1521 pixel.red = radial * show1;
1522 pixel.green = radial * (show1 - show2) / 6;
1523 pixel.blue = radial * (show1 - show3) / 5;
1524
1525 pixel = rgb_sanity_check(pixel);
1526 setPixelColorInternal(y, x, pixel);
1527 }
1528 }
1529 }
1530
1531 void Polar_Waves() { // nice one
1532
1533 get_ready();
1534
1535 timings.master_speed = 0.5; // master speed
1536
1537 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1538 // values = faster transitions
1539 timings.ratio[1] = 0.0027;
1540 timings.ratio[2] = 0.0031;
1541
1542 calculate_oscillators(timings);
1543
1544 for (int x = 0; x < num_x; x++) {
1545 for (int y = 0; y < num_y; y++) {
1546
1547 animation.dist = (distance[x][y]);
1548 animation.angle =
1549 polar_theta[x][y] - animation.dist * 0.1 + move.radial[0];
1550 animation.z = (animation.dist * 1.5) - 10 * move.linear[0];
1551 animation.scale_x = 0.15;
1552 animation.scale_y = 0.15;
1553 animation.offset_x = move.linear[0];
1554
1555 float show1 = render_value(animation);
1556 animation.angle =
1557 polar_theta[x][y] - animation.dist * 0.1 + move.radial[1];
1558 animation.z = (animation.dist * 1.5) - 10 * move.linear[1];
1559 animation.offset_x = move.linear[1];
1560
1561 float show2 = render_value(animation);
1562 animation.angle =
1563 polar_theta[x][y] - animation.dist * 0.1 + move.radial[2];
1564 animation.z = (animation.dist * 1.5) - 10 * move.linear[2];
1565 animation.offset_x = move.linear[2];
1566
1567 float show3 = render_value(animation);
1568
1569 float radius = radial_filter_radius; // radius of a radial
1570 // brightness filter
1571 float radial = (radius - distance[x][y]) / distance[x][y];
1572
1573 pixel.red = radial * show1;
1574 pixel.green = radial * show2;
1575 pixel.blue = radial * show3;
1576
1577 pixel = rgb_sanity_check(pixel);
1578 setPixelColorInternal(y, x, pixel);
1579 }
1580 }
1581 }
1582
1583 void RGB_Blobs() { // nice one
1584
1585 get_ready();
1586
1587 timings.master_speed = 0.2; // master speed
1588
1589 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1590 // values = faster transitions
1591 timings.ratio[1] = 0.0027;
1592 timings.ratio[2] = 0.0031;
1593 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1594 // values = faster transitions
1595 timings.ratio[4] = 0.0036;
1596 timings.ratio[5] = 0.0039;
1597
1598 calculate_oscillators(timings);
1599
1600 for (int x = 0; x < num_x; x++) {
1601 for (int y = 0; y < num_y; y++) {
1602
1603 animation.dist = distance[x][y];
1604 animation.angle = polar_theta[x][y] + move.radial[0] +
1605 move.noise_angle[0] + move.noise_angle[3];
1606 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1607 animation.scale_x = 0.1;
1608 animation.scale_y = 0.1;
1609 animation.offset_z = 10;
1610 animation.offset_x = 10 * move.linear[0];
1611 float show1 = render_value(animation);
1612
1613 animation.angle = polar_theta[x][y] + move.radial[1] +
1614 move.noise_angle[1] + move.noise_angle[4];
1615 animation.offset_x = 11 * move.linear[1];
1616 animation.offset_z = 100;
1617 float show2 = render_value(animation);
1618
1619 animation.angle = polar_theta[x][y] + move.radial[2] +
1620 move.noise_angle[2] + move.noise_angle[5];
1621 animation.offset_x = 12 * move.linear[2];
1622 animation.offset_z = 300;
1623 float show3 = render_value(animation);
1624
1625 float radius = radial_filter_radius; // radius of a radial
1626 // brightness filter
1627 float radial = (radius - distance[x][y]) / distance[x][y];
1628
1629 pixel.red = radial * show1;
1630 pixel.green = radial * show2;
1631 pixel.blue = radial * show3;
1632
1633 pixel = rgb_sanity_check(pixel);
1634 setPixelColorInternal(x, y, pixel);
1635 }
1636 }
1637 }
1638
1639 void RGB_Blobs2() { // nice one
1640
1641 get_ready();
1642
1643 timings.master_speed = 0.12; // master speed
1644
1645 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1646 // values = faster transitions
1647 timings.ratio[1] = 0.0027;
1648 timings.ratio[2] = 0.0031;
1649 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1650 // values = faster transitions
1651 timings.ratio[4] = 0.0036;
1652 timings.ratio[5] = 0.0039;
1653
1654 calculate_oscillators(timings);
1655
1656 for (int x = 0; x < num_x; x++) {
1657 for (int y = 0; y < num_y; y++) {
1658
1659 animation.dist = distance[x][y];
1660 animation.angle = polar_theta[x][y] + move.radial[0] +
1661 move.noise_angle[0] + move.noise_angle[3] +
1662 move.noise_angle[1];
1663 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1664 animation.scale_x = 0.1;
1665 animation.scale_y = 0.1;
1666 animation.offset_z = 10;
1667 animation.offset_x = 10 * move.linear[0];
1668 float show1 = render_value(animation);
1669
1670 animation.angle = polar_theta[x][y] + move.radial[1] +
1671 move.noise_angle[1] + move.noise_angle[4] +
1672 move.noise_angle[2];
1673 animation.offset_x = 11 * move.linear[1];
1674 animation.offset_z = 100;
1675 float show2 = render_value(animation);
1676
1677 animation.angle = polar_theta[x][y] + move.radial[2] +
1678 move.noise_angle[2] + move.noise_angle[5] +
1679 move.noise_angle[3];
1680 animation.offset_x = 12 * move.linear[2];
1681 animation.offset_z = 300;
1682 float show3 = render_value(animation);
1683
1684 float radius = radial_filter_radius; // radius of a radial
1685 // brightness filter
1686 float radial = (radius - distance[x][y]) / distance[x][y];
1687
1688 pixel.red = radial * (show1 - show3);
1689 pixel.green = radial * (show2 - show1);
1690 pixel.blue = radial * (show3 - show2);
1691
1692 pixel = rgb_sanity_check(pixel);
1693 setPixelColorInternal(x, y, pixel);
1694 }
1695 }
1696 }
1697
1698 void RGB_Blobs3() { // nice one
1699
1700 get_ready();
1701
1702 timings.master_speed = 0.12; // master speed
1703
1704 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1705 // values = faster transitions
1706 timings.ratio[1] = 0.0027;
1707 timings.ratio[2] = 0.0031;
1708 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1709 // values = faster transitions
1710 timings.ratio[4] = 0.0036;
1711 timings.ratio[5] = 0.0039;
1712
1713 calculate_oscillators(timings);
1714
1715 for (int x = 0; x < num_x; x++) {
1716 for (int y = 0; y < num_y; y++) {
1717
1718 animation.dist = distance[x][y] + move.noise_angle[4];
1719 animation.angle = polar_theta[x][y] + move.radial[0] +
1720 move.noise_angle[0] + move.noise_angle[3] +
1721 move.noise_angle[1];
1722 animation.z = (sqrtf(animation.dist)); // - 10 * move.linear[0];
1723 animation.scale_x = 0.1;
1724 animation.scale_y = 0.1;
1725 animation.offset_z = 10;
1726 animation.offset_x = 10 * move.linear[0];
1727 float show1 = render_value(animation);
1728
1729 animation.angle = polar_theta[x][y] + move.radial[1] +
1730 move.noise_angle[1] + move.noise_angle[4] +
1731 move.noise_angle[2];
1732 animation.offset_x = 11 * move.linear[1];
1733 animation.offset_z = 100;
1734 float show2 = render_value(animation);
1735
1736 animation.angle = polar_theta[x][y] + move.radial[2] +
1737 move.noise_angle[2] + move.noise_angle[5] +
1738 move.noise_angle[3];
1739 animation.offset_x = 12 * move.linear[2];
1740 animation.offset_z = 300;
1741 float show3 = render_value(animation);
1742
1743 float radius = radial_filter_radius; // radius of a radial
1744 // brightness filter
1745 float radial = (radius - distance[x][y]) / distance[x][y];
1746
1747 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1748 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1749 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1750
1751 pixel = rgb_sanity_check(pixel);
1752 setPixelColorInternal(y, x, pixel);
1753 }
1754 }
1755 }
1756
1757 void RGB_Blobs4() { // nice one
1758
1759 get_ready();
1760
1761 timings.master_speed = 0.02; // master speed
1762
1763 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1764 // values = faster transitions
1765 timings.ratio[1] = 0.0027;
1766 timings.ratio[2] = 0.0031;
1767 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1768 // values = faster transitions
1769 timings.ratio[4] = 0.0036;
1770 timings.ratio[5] = 0.0039;
1771
1772 calculate_oscillators(timings);
1773
1774 for (int x = 0; x < num_x; x++) {
1775 for (int y = 0; y < num_y; y++) {
1776
1777 animation.dist = distance[x][y] + move.noise_angle[4];
1778 animation.angle = polar_theta[x][y] + move.radial[0] +
1779 move.noise_angle[0] + move.noise_angle[3] +
1780 move.noise_angle[1];
1781 animation.z = 3 + sqrtf(animation.dist);
1782 animation.scale_x = 0.1;
1783 animation.scale_y = 0.1;
1784 animation.offset_z = 10;
1785 animation.offset_x = 50 * move.linear[0];
1786 float show1 = render_value(animation);
1787
1788 animation.angle = polar_theta[x][y] + move.radial[1] +
1789 move.noise_angle[1] + move.noise_angle[4] +
1790 move.noise_angle[2];
1791 animation.offset_x = 50 * move.linear[1];
1792 animation.offset_z = 100;
1793 float show2 = render_value(animation);
1794
1795 animation.angle = polar_theta[x][y] + move.radial[2] +
1796 move.noise_angle[2] + move.noise_angle[5] +
1797 move.noise_angle[3];
1798 animation.offset_x = 50 * move.linear[2];
1799 animation.offset_z = 300;
1800 float show3 = render_value(animation);
1801
1802 float radius = 23; // radius of a radial brightness filter
1803 float radial = (radius - distance[x][y]) / distance[x][y];
1804
1805 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1806 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1807 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1808
1809 pixel = rgb_sanity_check(pixel);
1810 setPixelColorInternal(y, x, pixel);
1811 }
1812 }
1813 }
1814
1815 void RGB_Blobs5() { // nice one
1816
1817 get_ready();
1818
1819 timings.master_speed = 0.02; // master speed
1820
1821 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1822 // values = faster transitions
1823 timings.ratio[1] = 0.0027;
1824 timings.ratio[2] = 0.0031;
1825 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1826 // values = faster transitions
1827 timings.ratio[4] = 0.0036;
1828 timings.ratio[5] = 0.0039;
1829
1830 calculate_oscillators(timings);
1831
1832 for (int x = 0; x < num_x; x++) {
1833 for (int y = 0; y < num_y; y++) {
1834
1835 animation.dist = distance[x][y] + move.noise_angle[4];
1836 animation.angle = polar_theta[x][y] + move.radial[0] +
1837 move.noise_angle[0] + move.noise_angle[3] +
1838 move.noise_angle[1];
1839 animation.z = 3 + sqrtf(animation.dist);
1840 animation.scale_x = 0.05;
1841 animation.scale_y = 0.05;
1842 animation.offset_z = 10;
1843 animation.offset_x = 50 * move.linear[0];
1844 float show1 = render_value(animation);
1845
1846 animation.angle = polar_theta[x][y] + move.radial[1] +
1847 move.noise_angle[1] + move.noise_angle[4] +
1848 move.noise_angle[2];
1849 animation.offset_x = 50 * move.linear[1];
1850 animation.offset_z = 100;
1851 float show2 = render_value(animation);
1852
1853 animation.angle = polar_theta[x][y] + move.radial[2] +
1854 move.noise_angle[2] + move.noise_angle[5] +
1855 move.noise_angle[3];
1856 animation.offset_x = 50 * move.linear[2];
1857 animation.offset_z = 300;
1858 float show3 = render_value(animation);
1859
1860 float radius = 23; // radius of a radial brightness filter
1861 float radial = (radius - distance[x][y]) / distance[x][y];
1862
1863 pixel.red = radial * (show1 + show3) * 0.5 * animation.dist / 5;
1864 pixel.green = radial * (show2 + show1) * 0.5 * y / 15;
1865 pixel.blue = radial * (show3 + show2) * 0.5 * x / 15;
1866
1867 pixel = rgb_sanity_check(pixel);
1868
1869 setPixelColorInternal(y, x, pixel);
1870 }
1871 }
1872 }
1873
1874 void Big_Caleido() { // nice one
1875
1876 get_ready();
1877
1878 timings.master_speed = 0.02; // master speed
1879
1880 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1881 // values = faster transitions
1882 timings.ratio[1] = 0.0027;
1883 timings.ratio[2] = 0.0031;
1884 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1885 // values = faster transitions
1886 timings.ratio[4] = 0.0036;
1887 timings.ratio[5] = 0.0039;
1888
1889 calculate_oscillators(timings);
1890
1891 for (int x = 0; x < num_x; x++) {
1892 for (int y = 0; y < num_y; y++) {
1893
1894 animation.dist = distance[x][y];
1895 animation.angle = 5 * polar_theta[x][y] +
1896 5 * move.noise_angle[0] +
1897 animation.dist * 0.1;
1898 animation.z = 5;
1899 animation.scale_x = 0.05;
1900 animation.scale_y = 0.05;
1901 animation.offset_z = 50 * move.linear[0];
1902 animation.offset_x = 50 * move.noise_angle[0];
1903 animation.offset_y = 50 * move.noise_angle[1];
1904 float show1 = render_value(animation);
1905
1906 animation.angle = 6 * polar_theta[x][y] +
1907 5 * move.noise_angle[1] +
1908 animation.dist * 0.15;
1909 animation.z = 5;
1910 animation.scale_x = 0.05;
1911 animation.scale_y = 0.05;
1912 animation.offset_z = 50 * move.linear[1];
1913 animation.offset_x = 50 * move.noise_angle[1];
1914 animation.offset_y = 50 * move.noise_angle[2];
1915 float show2 = render_value(animation);
1916
1917 animation.angle = 5;
1918 animation.z = 5;
1919 animation.scale_x = 0.10;
1920 animation.scale_y = 0.10;
1921 animation.offset_z = 10 * move.linear[2];
1922 animation.offset_x = 10 * move.noise_angle[2];
1923 animation.offset_y = 10 * move.noise_angle[3];
1924 float show3 = render_value(animation);
1925
1926 animation.angle = 15;
1927 animation.z = 15;
1928 animation.scale_x = 0.10;
1929 animation.scale_y = 0.10;
1930 animation.offset_z = 10 * move.linear[3];
1931 animation.offset_x = 10 * move.noise_angle[3];
1932 animation.offset_y = 10 * move.noise_angle[4];
1933 float show4 = render_value(animation);
1934
1935 animation.angle = 2;
1936 animation.z = 15;
1937 animation.scale_x = 0.15;
1938 animation.scale_y = 0.15;
1939 animation.offset_z = 10 * move.linear[4];
1940 animation.offset_x = 10 * move.noise_angle[4];
1941 animation.offset_y = 10 * move.noise_angle[5];
1942 float show5 = render_value(animation);
1943
1944 pixel.red = show1 - show4;
1945 pixel.green = show2 - show5;
1946 pixel.blue = show3 - show2 + show1;
1947
1948 pixel = rgb_sanity_check(pixel);
1949
1950 setPixelColorInternal(y, x, pixel);
1951 }
1952 }
1953 // show_frame();
1954 }
1955
1956 void SM1() { // nice one
1957
1958 get_ready();
1959
1960 timings.master_speed = 0.02; // master speed
1961
1962 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
1963 // values = faster transitions
1964 timings.ratio[1] = 0.0027;
1965 timings.ratio[2] = 0.0031;
1966 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
1967 // values = faster transitions
1968 timings.ratio[4] = 0.0036;
1969 timings.ratio[5] = 0.0039;
1970
1971 calculate_oscillators(timings);
1972
1973 for (int x = 0; x < num_x / 2; x++) {
1974 for (int y = 0; y < num_y / 2; y++) {
1975
1976 animation.dist = distance[x][y];
1977 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[0];
1978 animation.z = 5;
1979 animation.scale_x = 0.1;
1980 animation.scale_y = 0.1;
1981 animation.offset_z = 50 * move.linear[0];
1982 animation.offset_x = 150 * move.directional[0];
1983 animation.offset_y = 150 * move.directional[1];
1984 float show1 = render_value(animation);
1985
1986 animation.dist = distance[x][y];
1987 animation.angle = polar_theta[x][y] + 4 * move.noise_angle[1];
1988 animation.z = 15;
1989 animation.scale_x = 0.15;
1990 animation.scale_y = 0.15;
1991 animation.offset_z = 50 * move.linear[1];
1992 animation.offset_x = 150 * move.directional[1];
1993 animation.offset_y = 150 * move.directional[2];
1994 float show2 = render_value(animation);
1995
1996 animation.dist = distance[x][y];
1997 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[2];
1998 animation.z = 25;
1999 animation.scale_x = 0.1;
2000 animation.scale_y = 0.1;
2001 animation.offset_z = 50 * move.linear[2];
2002 animation.offset_x = 150 * move.directional[2];
2003 animation.offset_y = 150 * move.directional[3];
2004 float show3 = render_value(animation);
2005
2006 animation.dist = distance[x][y];
2007 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[3];
2008 animation.z = 35;
2009 animation.scale_x = 0.15;
2010 animation.scale_y = 0.15;
2011 animation.offset_z = 50 * move.linear[3];
2012 animation.offset_x = 150 * move.directional[3];
2013 animation.offset_y = 150 * move.directional[4];
2014 float show4 = render_value(animation);
2015
2016 animation.dist = distance[x][y];
2017 animation.angle = polar_theta[x][y] + 5 * move.noise_angle[4];
2018 animation.z = 45;
2019 animation.scale_x = 0.2;
2020 animation.scale_y = 0.2;
2021 animation.offset_z = 50 * move.linear[4];
2022 animation.offset_x = 150 * move.directional[4];
2023 animation.offset_y = 150 * move.directional[5];
2024 float show5 = render_value(animation);
2025
2026 pixel.red = show1 + show2;
2027 pixel.green = show3 + show4;
2028 pixel.blue = show5;
2029
2030 pixel = rgb_sanity_check(pixel);
2031 // leds[xyMap(x, y)] = CRGB(pixel.red, pixel.green, pixel.blue);
2032 setPixelColorInternal(x, y, pixel);
2033
2034 setPixelColorInternal((num_x - 1) - x, y, pixel);
2035 setPixelColorInternal((num_x - 1) - x, (num_y - 1) - y, pixel);
2036 setPixelColorInternal(x, (num_y - 1) - y, pixel);
2037 }
2038 }
2039 // show_frame();
2040 }
2041
2042 void SM2() {
2043
2044 get_ready();
2045
2046 timings.master_speed = 0.03; // master speed
2047
2048 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2049 // values = faster transitions
2050 timings.ratio[1] = 0.027;
2051 timings.ratio[2] = 0.031;
2052 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2053 // values = faster transitions
2054 timings.ratio[4] = 0.0036;
2055 timings.ratio[5] = 0.0039;
2056
2057 calculate_oscillators(timings);
2058
2059 for (int x = 0; x < num_x; x++) {
2060 for (int y = 0; y < num_y; y++) {
2061
2062 animation.dist = distance[x][y] * (move.directional[0]);
2063 animation.angle = polar_theta[x][y] + move.radial[0];
2064 animation.z = 5;
2065 animation.scale_x = 0.09;
2066 animation.scale_y = 0.09;
2067 animation.offset_z = 5 * move.linear[0];
2068 animation.offset_x = 0;
2069 animation.offset_y = 0;
2070 float show1 = render_value(animation);
2071
2072 animation.dist = distance[x][y] * move.directional[1];
2073 animation.angle = polar_theta[x][y] + move.radial[1];
2074 animation.z = 50;
2075 animation.scale_x = 0.07;
2076 animation.scale_y = 0.07;
2077 animation.offset_z = 5 * move.linear[1];
2078 animation.offset_x = 0;
2079 animation.offset_y = 0;
2080 float show2 = render_value(animation);
2081
2082 animation.dist = distance[x][y] * move.directional[2];
2083 animation.angle = polar_theta[x][y] + move.radial[2];
2084 animation.z = 500;
2085 animation.scale_x = 0.05;
2086 animation.scale_y = 0.05;
2087 animation.offset_z = 5 * move.linear[2];
2088 animation.offset_x = 0;
2089 animation.offset_y = 0;
2090 float show3 = render_value(animation);
2091
2092 pixel.red = show1;
2093 pixel.green = show2;
2094 pixel.blue = show3;
2095
2096 pixel = rgb_sanity_check(pixel);
2097
2098 setPixelColorInternal(x, y, pixel);
2099 }
2100 }
2101 // show_frame();
2102 }
2103
2104 void SM3() {
2105
2106 get_ready();
2107
2108 timings.master_speed = 0.02; // master speed
2109
2110 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2111 // values = faster transitions
2112 timings.ratio[1] = 0.027;
2113 timings.ratio[2] = 0.031;
2114 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2115 // values = faster transitions
2116 timings.ratio[4] = 0.0036;
2117 timings.ratio[5] = 0.0039;
2118
2119 calculate_oscillators(timings);
2120
2121 for (int x = 0; x < num_x; x++) {
2122 for (int y = 0; y < num_y; y++) {
2123
2124 animation.dist = distance[x][y];
2125 animation.angle = polar_theta[x][y];
2126 animation.z = 5;
2127 animation.scale_x = 0.09;
2128 animation.scale_y = 0.09;
2129 animation.offset_z = 0;
2130 animation.offset_x = 0;
2131 animation.offset_y = -20 * move.linear[0];
2132 ;
2133 animation.low_limit = -1;
2134 animation.high_limit = 1;
2135 show1 = render_value(animation);
2136
2137 animation.dist = distance[x][y];
2138 animation.angle = polar_theta[x][y];
2139 animation.z = 500;
2140 animation.scale_x = 0.09;
2141 animation.scale_y = 0.09;
2142 animation.offset_z = 0;
2143 animation.offset_x = 0;
2144 animation.offset_y = -20 * move.linear[0];
2145 ;
2146 animation.low_limit = -1;
2147 animation.high_limit = 1;
2148 show2 = render_value(animation);
2149
2150 animation.dist = distance[x][y];
2151 animation.angle = polar_theta[x][y];
2152 animation.z = 50;
2153 animation.scale_x = 0.09;
2154 animation.scale_y = 0.09;
2155 animation.offset_z = 0;
2156 animation.offset_x = 500 + show1 / 20;
2157 animation.offset_y = -4 * move.linear[0] + show2 / 20;
2158 animation.low_limit = 0;
2159 animation.high_limit = 1;
2160 show3 = render_value(animation);
2161
2162 animation.dist = distance[x][y];
2163 animation.angle = polar_theta[x][y];
2164 animation.z = 50;
2165 animation.scale_x = 0.09;
2166 animation.scale_y = 0.09;
2167 animation.offset_z = 0;
2168 animation.offset_x = 500 + show1 / 18;
2169 animation.offset_y = -4 * move.linear[0] + show2 / 18;
2170 animation.low_limit = 0;
2171 animation.high_limit = 1;
2172 show4 = render_value(animation);
2173
2174 animation.dist = distance[x][y];
2175 animation.angle = polar_theta[x][y];
2176 animation.z = 50;
2177 animation.scale_x = 0.09;
2178 animation.scale_y = 0.09;
2179 animation.offset_z = 0;
2180 animation.offset_x = 500 + show1 / 19;
2181 animation.offset_y = -4 * move.linear[0] + show2 / 19;
2182 animation.low_limit = 0.3;
2183 animation.high_limit = 1;
2184 show5 = render_value(animation);
2185
2186 pixel.red = show4;
2187 pixel.green = show3;
2188 pixel.blue = show5;
2189
2190 pixel = rgb_sanity_check(pixel);
2191
2192 setPixelColorInternal(x, y, pixel);
2193 }
2194 }
2195 }
2196
2197 void SM4() {
2198
2199 get_ready();
2200
2201 timings.master_speed = 0.02; // master speed
2202
2203 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2204 // values = faster transitions
2205 timings.ratio[1] = 0.027;
2206 timings.ratio[2] = 0.031;
2207 timings.ratio[3] = 0.0033; // speed ratios for the oscillators, higher
2208 // values = faster transitions
2209 timings.ratio[4] = 0.0036;
2210 timings.ratio[5] = 0.0039;
2211
2212 calculate_oscillators(timings);
2213
2214 for (int x = 0; x < num_x; x++) {
2215 for (int y = 0; y < num_y; y++) {
2216
2217 animation.dist = distance[x][y];
2218 animation.angle = polar_theta[x][y];
2219 animation.z = 5;
2220 animation.scale_x = 0.09;
2221 animation.scale_y = 0.09;
2222 animation.offset_z = 0;
2223 animation.offset_x = 0;
2224 animation.offset_y = -20 * move.linear[0];
2225 ;
2226 animation.low_limit = 0;
2227 animation.high_limit = 1;
2228 show1 = render_value(animation);
2229
2230 animation.dist = distance[x][y];
2231 animation.angle = polar_theta[x][y];
2232 animation.z = 500;
2233 animation.scale_x = 0.09;
2234 animation.scale_y = 0.09;
2235 animation.offset_z = 0;
2236 animation.offset_x = 0;
2237 animation.offset_y = -40 * move.linear[0];
2238 ;
2239 animation.low_limit = 0;
2240 animation.high_limit = 1;
2241 show2 = render_value(animation);
2242
2243 pixel.red = add(show2, show1);
2244 pixel.green = 0;
2245 pixel.blue = colordodge(show2, show1);
2246
2247 pixel = rgb_sanity_check(pixel);
2248
2249 setPixelColorInternal(x, y, pixel);
2250 }
2251 }
2252 }
2253
2254 void SM5() {
2255
2256 get_ready();
2257
2258 timings.master_speed = 0.03; // master speed
2259
2260 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2261 // values = faster transitions
2262 timings.ratio[1] = 0.027;
2263 timings.ratio[2] = 0.031;
2264 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2265 // values = faster transitions
2266 timings.ratio[4] = 0.0056;
2267 timings.ratio[5] = 0.0059;
2268
2269 calculate_oscillators(timings);
2270
2271 for (int x = 0; x < num_x; x++) {
2272 for (int y = 0; y < num_y; y++) {
2273
2274 animation.dist = distance[x][y] * (move.directional[0]);
2275 animation.angle = polar_theta[x][y] + move.radial[0];
2276 animation.z = 5;
2277 animation.scale_x = 0.09;
2278 animation.scale_y = 0.09;
2279 animation.offset_z = 5 * move.linear[0];
2280 animation.offset_x = 0;
2281 animation.offset_y = 0;
2282 float show1 = render_value(animation);
2283
2284 animation.dist = distance[x][y] * move.directional[1];
2285 animation.angle = polar_theta[x][y] + move.radial[1];
2286 animation.z = 50;
2287 animation.scale_x = 0.07;
2288 animation.scale_y = 0.07;
2289 animation.offset_z = 5 * move.linear[1];
2290 animation.offset_x = 0;
2291 animation.offset_y = 0;
2292 float show2 = render_value(animation);
2293
2294 animation.dist = distance[x][y] * move.directional[2];
2295 animation.angle = polar_theta[x][y] + move.radial[2];
2296 animation.z = 500;
2297 animation.scale_x = 0.05;
2298 animation.scale_y = 0.05;
2299 animation.offset_z = 5 * move.linear[2];
2300 animation.offset_x = 0;
2301 animation.offset_y = 0;
2302 float show3 = render_value(animation);
2303
2304 animation.dist = distance[x][y] * (move.directional[3]);
2305 animation.angle = polar_theta[x][y] + move.radial[3];
2306 animation.z = 5;
2307 animation.scale_x = 0.09;
2308 animation.scale_y = 0.09;
2309 animation.offset_z = 5 * move.linear[3];
2310 animation.offset_x = 0;
2311 animation.offset_y = 0;
2312 float show4 = render_value(animation);
2313
2314 animation.dist = distance[x][y] * move.directional[4];
2315 animation.angle = polar_theta[x][y] + move.radial[4];
2316 animation.z = 50;
2317 animation.scale_x = 0.07;
2318 animation.scale_y = 0.07;
2319 animation.offset_z = 5 * move.linear[4];
2320 animation.offset_x = 0;
2321 animation.offset_y = 0;
2322 float show5 = render_value(animation);
2323
2324 animation.dist = distance[x][y] * move.directional[5];
2325 animation.angle = polar_theta[x][y] + move.radial[5];
2326 animation.z = 500;
2327 animation.scale_x = 0.05;
2328 animation.scale_y = 0.05;
2329 animation.offset_z = 5 * move.linear[5];
2330 animation.offset_x = 0;
2331 animation.offset_y = 0;
2332 float show6 = render_value(animation);
2333
2334 float radius = radial_filter_radius; // radius of a radial
2335 // brightness filter
2336 float radial = (radius - distance[x][y]) / distance[x][y];
2337
2338 pixel.red = radial * add(show1, show4);
2339 pixel.green = radial * colordodge(show2, show5);
2340 pixel.blue = radial * screen(show3, show6);
2341
2342 pixel = rgb_sanity_check(pixel);
2343
2344 setPixelColorInternal(x, y, pixel);
2345 }
2346 }
2347 }
2348
2349 void SM6() {
2350
2351 get_ready();
2352
2353 timings.master_speed = 0.03; // master speed
2354
2355 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2356 // values = faster transitions
2357 timings.ratio[1] = 0.027;
2358 timings.ratio[2] = 0.031;
2359 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2360 // values = faster transitions
2361 timings.ratio[4] = 0.0056;
2362 timings.ratio[5] = 0.0059;
2363
2364 calculate_oscillators(timings);
2365
2366 for (int x = 0; x < num_x; x++) {
2367 for (int y = 0; y < num_y; y++) {
2368
2369 float s = 0.7; // zoom factor
2370
2371 animation.dist = distance[x][y] * (move.directional[0]) * s;
2372 animation.angle = polar_theta[x][y] + move.radial[0];
2373 animation.z = 5;
2374 animation.scale_x = 0.09;
2375 animation.scale_y = 0.09;
2376 animation.offset_z = 5 * move.linear[0];
2377 animation.offset_x = 0;
2378 animation.offset_y = 0;
2379 float show1 = render_value(animation);
2380
2381 animation.dist = distance[x][y] * move.directional[1] * s;
2382 animation.angle = polar_theta[x][y] + move.radial[1];
2383 animation.z = 50;
2384 animation.scale_x = 0.07;
2385 animation.scale_y = 0.07;
2386 animation.offset_z = 5 * move.linear[1];
2387 animation.offset_x = 0;
2388 animation.offset_y = 0;
2389 float show2 = render_value(animation);
2390
2391 animation.dist = distance[x][y] * move.directional[2] * s;
2392 animation.angle = polar_theta[x][y] + move.radial[2];
2393 animation.z = 500;
2394 animation.scale_x = 0.05;
2395 animation.scale_y = 0.05;
2396 animation.offset_z = 5 * move.linear[2];
2397 animation.offset_x = 0;
2398 animation.offset_y = 0;
2399 float show3 = render_value(animation);
2400
2401 animation.dist = distance[x][y] * (move.directional[3]) * s;
2402 animation.angle = polar_theta[x][y] + move.radial[3];
2403 animation.z = 5;
2404 animation.scale_x = 0.09;
2405 animation.scale_y = 0.09;
2406 animation.offset_z = 5 * move.linear[3];
2407 animation.offset_x = 0;
2408 animation.offset_y = 0;
2409 float show4 = render_value(animation);
2410
2411 animation.dist = distance[x][y] * move.directional[4] * s;
2412 animation.angle = polar_theta[x][y] + move.radial[4];
2413 animation.z = 50;
2414 animation.scale_x = 0.07;
2415 animation.scale_y = 0.07;
2416 animation.offset_z = 5 * move.linear[4];
2417 animation.offset_x = 0;
2418 animation.offset_y = 0;
2419 float show5 = render_value(animation);
2420
2421 animation.dist = distance[x][y] * move.directional[5] * s;
2422 animation.angle = polar_theta[x][y] + move.radial[5];
2423 animation.z = 500;
2424 animation.scale_x = 0.05;
2425 animation.scale_y = 0.05;
2426 animation.offset_z = 5 * move.linear[5];
2427 animation.offset_x = 0;
2428 animation.offset_y = 0;
2429 float show6 = render_value(animation);
2430
2431 float radius = radial_filter_radius; // radius of a radial
2432 // brightness filter
2433 float radial = (radius - distance[x][y]) / distance[x][y];
2434
2435 show7 = screen(show1, show4);
2436 show8 = colordodge(show2, show5);
2437 show9 = screen(show3, show6);
2438
2439 pixel.red = radial * (show7 + show8);
2440 pixel.green = 0;
2441 pixel.blue = radial * show9;
2442
2443 pixel = rgb_sanity_check(pixel);
2444
2445 setPixelColorInternal(x, y, pixel);
2446 }
2447 }
2448 }
2449
2450 void SM8() {
2451
2452 get_ready();
2453
2454 timings.master_speed = 0.03; // master speed
2455
2456 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2457 // values = faster transitions
2458 timings.ratio[1] = 0.027;
2459 timings.ratio[2] = 0.031;
2460 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2461 // values = faster transitions
2462 timings.ratio[4] = 0.0056;
2463 timings.ratio[5] = 0.01; // original Reddit post had no radial movement!
2464
2465 calculate_oscillators(timings);
2466
2467 for (int x = 0; x < num_x; x++) {
2468 for (int y = 0; y < num_y; y++) {
2469
2470 // float s = 0.7; // zoom factor
2471
2472 animation.dist = distance[x][y];
2473 animation.angle = 2;
2474 animation.z = 5;
2475 animation.scale_x = 0.15;
2476 animation.scale_y = 0.15;
2477 animation.offset_z = 0;
2478 animation.offset_y = 50 * move.linear[0];
2479 animation.offset_x = 0;
2480 animation.low_limit = 0;
2481 float show1 = render_value(animation);
2482
2483 animation.dist = distance[x][y];
2484 animation.angle = 2;
2485 animation.z = 150;
2486 animation.offset_x = -50 * move.linear[0];
2487 float show2 = render_value(animation);
2488
2489 animation.dist = distance[x][y];
2490 animation.angle = 1;
2491 animation.z = 550;
2492 animation.scale_x = 0.15;
2493 animation.scale_y = 0.15;
2494 animation.offset_x = 0;
2495 animation.offset_y = -50 * move.linear[1];
2496 float show4 = render_value(animation);
2497
2498 animation.dist = distance[x][y];
2499 animation.angle = 1;
2500 animation.z = 1250;
2501 animation.scale_x = 0.15;
2502 animation.scale_y = 0.15;
2503 animation.offset_x = 0;
2504 animation.offset_y = 50 * move.linear[1];
2505 float show5 = render_value(animation);
2506
2507 // float radius = radial_filter_radius; // radius of a radial
2508 // brightness filter float radial =
2509 // (radius-distance[x][y])/distance[x][y];
2510
2511 show3 = add(show1, show2);
2512 show6 = screen(show4, show5);
2513 // show9 = screen(show3, show6);
2514
2515 pixel.red = show3;
2516 pixel.green = 0;
2517 pixel.blue = show6;
2518
2519 pixel = rgb_sanity_check(pixel);
2520
2521 setPixelColorInternal(x, y, pixel);
2522 }
2523 }
2524 }
2525
2526 void SM9() {
2527
2528 get_ready();
2529
2530 timings.master_speed = 0.005; // master speed
2531
2532 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2533 // values = faster transitions
2534 timings.ratio[1] = 0.027;
2535 timings.ratio[2] = 0.031;
2536 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2537 // values = faster transitions
2538 timings.ratio[4] = 0.0056;
2539 timings.ratio[5] = 0.0059;
2540
2541 calculate_oscillators(timings);
2542
2543 for (int x = 0; x < num_x; x++) {
2544 for (int y = 0; y < num_y; y++) {
2545
2546 animation.dist = distance[x][y];
2547 animation.angle = polar_theta[x][y];
2548 animation.z = 5;
2549 animation.scale_x = 0.09;
2550 animation.scale_y = 0.09;
2551 animation.offset_y = -30 * move.linear[0];
2552 animation.offset_z = 0;
2553 animation.offset_x = 0;
2554 animation.low_limit = -1;
2555 show1 = render_value(animation);
2556
2557 animation.dist = distance[x][y];
2558 animation.angle = polar_theta[x][y];
2559 animation.z = 50;
2560 animation.scale_x = 0.09;
2561 animation.scale_y = 0.09;
2562 animation.offset_y = -30 * move.linear[1];
2563 animation.offset_z = 0;
2564 animation.offset_x = 0;
2565 animation.low_limit = -1;
2566 show2 = render_value(animation);
2567
2568 animation.dist = distance[x][y]; // + show1/64;
2569 animation.angle = polar_theta[x][y] + 2 + (show1 / 255) * PI;
2570 animation.z = 5;
2571 animation.scale_x = 0.09;
2572 animation.scale_y = 0.09;
2573 animation.offset_y = -10 * move.linear[0];
2574 animation.offset_z = 0;
2575 animation.offset_x = 0;
2576 animation.low_limit = 0;
2577 show3 = render_value(animation);
2578
2579 animation.dist = distance[x][y];
2580 animation.angle = polar_theta[x][y] + 2 + (show2 / 255) * PI;
2581 ;
2582 animation.z = 5;
2583 animation.scale_x = 0.09;
2584 animation.scale_y = 0.09;
2585 animation.offset_y = -20 * move.linear[0];
2586 animation.offset_z = 0;
2587 animation.offset_x = 0;
2588 animation.low_limit = 0;
2589 show4 = render_value(animation);
2590
2591 show5 = screen(show4, show3);
2592 show6 = colordodge(show5, show3);
2593
2594 float linear1 = y / 32.f;
2595 float linear2 = (32 - y) / 32.f;
2596
2597 pixel.red = show5 * linear1;
2598 pixel.green = 0;
2599 pixel.blue = show6 * linear2;
2600
2601 pixel = rgb_sanity_check(pixel);
2602
2603 setPixelColorInternal(x, y, pixel);
2604 }
2605 }
2606 }
2607
2608 void SM10() {
2609
2610 get_ready();
2611
2612 timings.master_speed = 0.006; // 0.006
2613
2614 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2615 // values = faster transitions
2616 timings.ratio[1] = 0.027;
2617 timings.ratio[2] = 0.031;
2618 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2619 // values = faster transitions
2620 timings.ratio[4] = 0.0056;
2621 timings.ratio[5] = 0.0059;
2622
2623 calculate_oscillators(timings);
2624
2625 for (int x = 0; x < num_x; x++) {
2626 for (int y = 0; y < num_y; y++) {
2627
2628 float scale = 0.6;
2629
2630 animation.dist = distance[x][y];
2631 animation.angle = polar_theta[x][y];
2632 animation.z = 5;
2633 animation.scale_x = 0.09 * scale;
2634 animation.scale_y = 0.09 * scale;
2635 animation.offset_y = -30 * move.linear[0];
2636 animation.offset_z = 0;
2637 animation.offset_x = 0;
2638 animation.low_limit = -1;
2639 show1 = render_value(animation);
2640
2641 animation.dist = distance[x][y];
2642 animation.angle = polar_theta[x][y];
2643 animation.z = 50;
2644 animation.scale_x = 0.09 * scale;
2645 animation.scale_y = 0.09 * scale;
2646 animation.offset_y = -30 * move.linear[1];
2647 animation.offset_z = 0;
2648 animation.offset_x = 0;
2649 animation.low_limit = -1;
2650 show2 = render_value(animation);
2651
2652 animation.dist = distance[x][y]; // + show1/64;
2653 animation.angle = polar_theta[x][y] + 2 + (show1 / 255) * PI;
2654 animation.z = 5;
2655 animation.scale_x = 0.09 * scale;
2656 animation.scale_y = 0.09 * scale;
2657 animation.offset_y = -10 * move.linear[0];
2658 animation.offset_z = 0;
2659 animation.offset_x = 0;
2660 animation.low_limit = 0;
2661 show3 = render_value(animation);
2662
2663 animation.dist = distance[x][y];
2664 animation.angle = polar_theta[x][y] + 2 + (show2 / 255) * PI;
2665 ;
2666 animation.z = 5;
2667 animation.scale_x = 0.09 * scale;
2668 animation.scale_y = 0.09 * scale;
2669 animation.offset_y = -20 * move.linear[0];
2670 animation.offset_z = 0;
2671 animation.offset_x = 0;
2672 animation.low_limit = 0;
2673 show4 = render_value(animation);
2674
2675 show5 = screen(show4, show3);
2676 show6 = colordodge(show5, show3);
2677
2678 // float linear1 = y / 32.f;
2679 // float linear2 = (32-y) / 32.f;
2680
2681 pixel.red = (show5 + show6) / 2;
2682 pixel.green = (show5 - 50) + (show6 / 16);
2683 pixel.blue = 0; // show6;
2684
2685 pixel = rgb_sanity_check(pixel);
2686
2687 setPixelColorInternal(x, y, pixel);
2688 }
2689 }
2690 }
2691
2692 void Complex_Kaleido() {
2693
2694 get_ready();
2695
2696 timings.master_speed = 0.009; // master speed
2697
2698 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2699 // values = faster transitions
2700 timings.ratio[1] = 0.027;
2701 timings.ratio[2] = 0.031;
2702 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2703 // values = faster transitions
2704 timings.ratio[4] = 0.0056;
2705 timings.ratio[5] = 0.0059;
2706
2707 calculate_oscillators(timings);
2708
2709 // float size = 1.5;
2710
2711 for (int x = 0; x < num_x; x++) {
2712 for (int y = 0; y < num_y; y++) {
2713
2714 animation.dist = distance[x][y];
2715 animation.angle = 5 * polar_theta[x][y] + 10 * move.radial[0] +
2716 animation.dist / 2;
2717 animation.z = 5;
2718 animation.scale_x = 0.07;
2719 animation.scale_y = 0.07;
2720 animation.offset_z = 0;
2721 animation.offset_x = -30 * move.linear[0];
2722 animation.offset_y = 0;
2723 animation.low_limit = 0;
2724 show1 = render_value(animation);
2725
2726 animation.dist = distance[x][y];
2727 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[1] +
2728 animation.dist / 2;
2729 animation.z = 500;
2730 animation.scale_x = 0.07;
2731 animation.scale_y = 0.07;
2732 animation.offset_z = 0;
2733 animation.offset_x = -30 * move.linear[1];
2734 animation.offset_y = 0;
2735 animation.low_limit = 0;
2736 show2 = render_value(animation);
2737
2738 animation.dist = distance[x][y];
2739 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[2] +
2740 animation.dist / 2;
2741 animation.z = 500;
2742 animation.scale_x = 0.05;
2743 animation.scale_y = 0.05;
2744 animation.offset_z = 0;
2745 animation.offset_x = -40 * move.linear[2];
2746 animation.offset_y = 0;
2747 animation.low_limit = 0;
2748 show3 = render_value(animation);
2749
2750 animation.dist = distance[x][y];
2751 animation.angle = 5 * polar_theta[x][y] + 12 * move.radial[3] +
2752 animation.dist / 2;
2753 animation.z = 500;
2754 animation.scale_x = 0.09;
2755 animation.scale_y = 0.09;
2756 animation.offset_z = 0;
2757 animation.offset_x = -35 * move.linear[3];
2758 animation.offset_y = 0;
2759 animation.low_limit = 0;
2760 show4 = render_value(animation);
2761
2762 show5 = screen(show4, show3);
2763 show6 = colordodge(show2, show3);
2764
2765 // float linear1 = y / 32.f;
2766 // float linear2 = (32-y) / 32.f;
2767
2768 float radius = radial_filter_radius; // radius of a radial
2769 // brightness filter
2770 float radial = (radius - distance[x][y]) / distance[x][y];
2771
2772 pixel.red = radial * (show1 + show2);
2773 pixel.green = 0.3 * radial * show6; //(radial*(show1))*0.3f;
2774 pixel.blue = radial * show5;
2775
2776 pixel = rgb_sanity_check(pixel);
2777
2778 setPixelColorInternal(x, y, pixel);
2779 }
2780 }
2781 }
2782
2783 void Complex_Kaleido_2() {
2784
2785 get_ready();
2786
2787 timings.master_speed = 0.009; // master speed
2788
2789 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2790 // values = faster transitions
2791 timings.ratio[1] = 0.027;
2792 timings.ratio[2] = 0.031;
2793 timings.ratio[3] = 0.0053; // speed ratios for the oscillators, higher
2794 // values = faster transitions
2795 timings.ratio[4] = 0.0056;
2796 timings.ratio[5] = 0.0059;
2797
2798 calculate_oscillators(timings);
2799
2800 float size = 0.5;
2801
2802 for (int x = 0; x < num_x; x++) {
2803 for (int y = 0; y < num_y; y++) {
2804
2805 animation.dist = distance[x][y];
2806 animation.angle = 5 * polar_theta[x][y] + 10 * move.radial[0] +
2807 animation.dist / 2;
2808 animation.z = 5;
2809 animation.scale_x = 0.07 * size;
2810 animation.scale_y = 0.07 * size;
2811 animation.offset_z = 0;
2812 animation.offset_x = -30 * move.linear[0];
2813 animation.offset_y = 0;
2814 animation.low_limit = 0;
2815 show1 = render_value(animation);
2816
2817 animation.dist = distance[x][y];
2818 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[1] +
2819 animation.dist / 2;
2820 animation.z = 500;
2821 animation.scale_x = 0.07 * size;
2822 animation.scale_y = 0.07 * size;
2823 animation.offset_z = 0;
2824 animation.offset_x = -30 * move.linear[1];
2825 animation.offset_y = 0;
2826 animation.low_limit = 0;
2827 show2 = render_value(animation);
2828
2829 animation.dist = distance[x][y];
2830 animation.angle = -5 * polar_theta[x][y] + 12 * move.radial[2] +
2831 animation.dist / 2;
2832 animation.z = 500;
2833 animation.scale_x = 0.05 * size;
2834 animation.scale_y = 0.05 * size;
2835 animation.offset_z = 0;
2836 animation.offset_x = -40 * move.linear[2];
2837 animation.offset_y = 0;
2838 animation.low_limit = 0;
2839 show3 = render_value(animation);
2840
2841 animation.dist = distance[x][y];
2842 animation.angle = 5 * polar_theta[x][y] + 12 * move.radial[3] +
2843 animation.dist / 2;
2844 animation.z = 500;
2845 animation.scale_x = 0.09 * size;
2846 animation.scale_y = 0.09 * size;
2847 animation.offset_z = 0;
2848 animation.offset_x = -35 * move.linear[3];
2849 animation.offset_y = 0;
2850 animation.low_limit = 0;
2851 show4 = render_value(animation);
2852
2853 show5 = screen(show4, show3);
2854 show6 = colordodge(show2, show3);
2855
2856 // float linear1 = y / 32.f;
2857 // float linear2 = (32-y) / 32.f;
2858
2859 float radius = radial_filter_radius; // radius of a radial
2860 // brightness filter
2861 float radial = (radius - distance[x][y]) / distance[x][y];
2862
2863 pixel.red = radial * (show1 + show2);
2864 pixel.green = 0.3 * radial * show6; //(radial*(show1))*0.3f;
2865 pixel.blue = radial * show5;
2866
2867 pixel = rgb_sanity_check(pixel);
2868
2869 setPixelColorInternal(x, y, pixel);
2870 }
2871 }
2872 }
2873
2874 void Complex_Kaleido_3() {
2875
2876 get_ready();
2877
2878 timings.master_speed = 0.001; // master speed
2879
2880 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2881 // values = faster transitions
2882 timings.ratio[1] = 0.027;
2883 timings.ratio[2] = 0.031;
2884 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
2885 // values = faster transitions
2886 timings.ratio[4] = 0.037;
2887 timings.ratio[5] = 0.038;
2888 timings.ratio[5] = 0.041;
2889
2890 calculate_oscillators(timings);
2891
2892 float size = 0.4 + move.directional[0] * 0.1;
2893
2894 float q = 2;
2895
2896 for (int x = 0; x < num_x; x++) {
2897 for (int y = 0; y < num_y; y++) {
2898
2899 animation.dist = distance[x][y];
2900 animation.angle =
2901 5 * polar_theta[x][y] + 10 * move.radial[0] +
2902 animation.dist / (((move.directional[0] + 3) * 2)) +
2903 move.noise_angle[0] * q;
2904 animation.z = 5;
2905 animation.scale_x = 0.08 * size * (move.directional[0] + 1.5);
2906 animation.scale_y = 0.07 * size;
2907 animation.offset_z = -10 * move.linear[0];
2908 animation.offset_x = -30 * move.linear[0];
2909 animation.offset_y = 0;
2910 animation.low_limit = 0;
2911 show1 = render_value(animation);
2912
2913 animation.dist = distance[x][y];
2914 animation.angle =
2915 -5 * polar_theta[x][y] + 10 * move.radial[1] +
2916 animation.dist / (((move.directional[1] + 3) * 2)) +
2917 move.noise_angle[1] * q;
2918 animation.z = 500;
2919 animation.scale_x = 0.07 * size * (move.directional[1] + 1.1);
2920 animation.scale_y = 0.07 * size * (move.directional[2] + 1.3);
2921 ;
2922 animation.offset_z = -12 * move.linear[1];
2923 ;
2924 animation.offset_x = -(num_x - 1) * move.linear[1];
2925 animation.offset_y = 0;
2926 animation.low_limit = 0;
2927 show2 = render_value(animation);
2928
2929 animation.dist = distance[x][y];
2930 animation.angle =
2931 -5 * polar_theta[x][y] + 12 * move.radial[2] +
2932 animation.dist / (((move.directional[3] + 3) * 2)) +
2933 move.noise_angle[2] * q;
2934 animation.z = 500;
2935 animation.scale_x = 0.05 * size * (move.directional[3] + 1.5);
2936 ;
2937 animation.scale_y = 0.05 * size * (move.directional[4] + 1.5);
2938 ;
2939 animation.offset_z = -12 * move.linear[3];
2940 animation.offset_x = -40 * move.linear[3];
2941 animation.offset_y = 0;
2942 animation.low_limit = 0;
2943 show3 = render_value(animation);
2944
2945 animation.dist = distance[x][y];
2946 animation.angle =
2947 5 * polar_theta[x][y] + 12 * move.radial[3] +
2948 animation.dist / (((move.directional[5] + 3) * 2)) +
2949 move.noise_angle[3] * q;
2950 animation.z = 500;
2951 animation.scale_x = 0.09 * size * (move.directional[5] + 1.5);
2952 ;
2953 ;
2954 animation.scale_y = 0.09 * size * (move.directional[6] + 1.5);
2955 ;
2956 ;
2957 animation.offset_z = 0;
2958 animation.offset_x = -35 * move.linear[3];
2959 animation.offset_y = 0;
2960 animation.low_limit = 0;
2961 show4 = render_value(animation);
2962
2963 show5 = screen(show4, show3) - show2;
2964 show6 = colordodge(show4, show1);
2965
2966 show7 = multiply(show1, show2);
2967
2968 float linear1 = y / 32.f;
2969 // float linear2 = (32-y) / 32.f;
2970
2971 float radius = radial_filter_radius; // radius of a radial
2972 // brightness filter
2973 float radial = (radius - distance[x][y]) / distance[x][y];
2974
2975 show7 = multiply(show1, show2) * linear1 * 2;
2976 show8 = subtract(show7, show5);
2977
2978 // pixel.red = radial*(show1+show2);
2979 pixel.green = 0.2 * show8; //(radial*(show1))*0.3f;
2980 pixel.blue = show5 * radial;
2981 pixel.red = (1 * show1 + 1 * show2) - show7 / 2;
2982
2983 pixel = rgb_sanity_check(pixel);
2984
2985 setPixelColorInternal(x, y, pixel);
2986 }
2987 }
2988 }
2989
2990 void Complex_Kaleido_4() {
2991
2992 get_ready();
2993
2994 timings.master_speed = 0.01; // master speed 0.01 in the video
2995
2996 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
2997 // values = faster transitions
2998 timings.ratio[1] = 0.027;
2999 timings.ratio[2] = 0.031;
3000 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3001 // values = faster transitions
3002 timings.ratio[4] = 0.037;
3003 timings.ratio[5] = 0.038;
3004 timings.ratio[6] = 0.041;
3005
3006 calculate_oscillators(timings);
3007
3008 float size = 0.6;
3009
3010 float q = 1;
3011
3012 for (int x = 0; x < num_x; x++) {
3013 for (int y = 0; y < num_y; y++) {
3014
3015 float s = 1 + move.directional[6] * 0.3;
3016
3017 animation.dist = distance[x][y] * s;
3018 animation.angle =
3019 5 * polar_theta[x][y] + 1 * move.radial[0] -
3020 animation.dist / (3 + move.directional[0] * 0.5);
3021 animation.z = 5;
3022 animation.scale_x = 0.08 * size + (move.directional[0] * 0.01);
3023 animation.scale_y = 0.07 * size + (move.directional[1] * 0.01);
3024 animation.offset_z = -10 * move.linear[0];
3025 animation.offset_x = 0; //-30 * move.linear[0];
3026 animation.offset_y = 0;
3027 animation.low_limit = 0;
3028 show1 = render_value(animation);
3029
3030 animation.dist = distance[x][y] * s;
3031 animation.angle =
3032 5 * polar_theta[x][y] + 1 * move.radial[1] +
3033 animation.dist / (3 + move.directional[1] * 0.5);
3034 animation.z = 50;
3035 animation.scale_x = 0.08 * size + (move.directional[1] * 0.01);
3036 animation.scale_y = 0.07 * size + (move.directional[2] * 0.01);
3037 animation.offset_z = -10 * move.linear[1];
3038 animation.offset_x = 0; //-30 * move.linear[0];
3039 animation.offset_y = 0;
3040 animation.low_limit = 0;
3041 show2 = render_value(animation);
3042
3043 animation.dist = distance[x][y];
3044 animation.angle = 1;
3045 animation.z = 500;
3046 animation.scale_x = 0.2 * size;
3047 animation.scale_y = 0.2 * size;
3048 animation.offset_z = 0; //-12 * move.linear[3];
3049 animation.offset_y = +7 * move.linear[3] + move.noise_angle[3];
3050 animation.offset_x = 0;
3051 animation.low_limit = 0;
3052 show3 = render_value(animation);
3053
3054 animation.dist = distance[x][y];
3055 animation.angle =
3056 5 * polar_theta[x][y] + 12 * move.radial[3] +
3057 animation.dist / (((move.directional[5] + 3) * 2)) +
3058 move.noise_angle[3] * q;
3059 animation.z = 500;
3060 animation.scale_x = 0.09 * size * (move.directional[5] + 1.5);
3061 ;
3062 ;
3063 animation.scale_y = 0.09 * size * (move.directional[6] + 1.5);
3064 ;
3065 ;
3066 animation.offset_z = 0;
3067 animation.offset_x = -35 * move.linear[3];
3068 animation.offset_y = 0;
3069 animation.low_limit = 0;
3070 show4 = render_value(animation);
3071
3072 // show5 = screen(show4, show3)-show2;
3073 // show6 = colordodge(show4, show1);
3074
3075 // show7 = multiply(show1, show2);
3076 /*
3077 float linear1 = y / 32.f;
3078 float linear2 = (32-y) / 32.f;
3079 */
3080
3081 float radius = radial_filter_radius; // radius of a radial
3082 // brightness filter
3083 float radial = (radius - distance[x][y]) / distance[x][y];
3084 /*
3085 show7 = multiply(show1, show2) * linear1*2;
3086 show8 = subtract(show7, show5);
3087 */
3088
3089 show5 = ((show1 + show2)) - show3;
3090 if (show5 > 255)
3091 show5 = 255;
3092 if (show5 < 0)
3093 show5 = 0;
3094
3095 show6 = colordodge(show1, show2);
3096
3097 pixel.red = show5 * radial;
3098 pixel.blue = (64 - show5 - show3) * radial;
3099 pixel.green = 0.5 * (show6);
3100 // pixel.blue = show5 * radial;
3101 // pixel.red = (1*show1 + 1*show2) - show7/2;
3102
3103 pixel = rgb_sanity_check(pixel);
3104
3105 setPixelColorInternal(x, y, pixel);
3106 }
3107 }
3108 }
3109
3110 void Complex_Kaleido_5() {
3111
3112 get_ready();
3113
3114 timings.master_speed = 0.01; // master speed
3115
3116 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3117 // values = faster transitions
3118 timings.ratio[1] = 0.027;
3119 timings.ratio[2] = 0.031;
3120 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3121 // values = faster transitions
3122 timings.ratio[4] = 0.037;
3123 timings.ratio[5] = 0.0038;
3124 timings.ratio[6] = 0.041;
3125
3126 calculate_oscillators(timings);
3127
3128 float size = 0.6;
3129
3130 // float q = 1;
3131
3132 for (int x = 0; x < num_x; x++) {
3133 for (int y = 0; y < num_y; y++) {
3134
3135 float s = 1 + move.directional[6] * 0.8;
3136
3137 animation.dist = distance[x][y] * s;
3138 animation.angle = 10 * move.radial[6] +
3139 50 * move.directional[5] * polar_theta[x][y] -
3140 animation.dist / 3;
3141 animation.z = 5;
3142 animation.scale_x = 0.08 * size;
3143 animation.scale_y = 0.07 * size;
3144 animation.offset_z = -10 * move.linear[0];
3145 animation.offset_x = 0;
3146 animation.offset_y = 0;
3147 animation.low_limit = -0.5;
3148 show1 = render_value(animation);
3149
3150 float radius = radial_filter_radius; // radius of a radial
3151 // brightness filter
3152 float radial = (radius - distance[x][y]) / distance[x][y];
3153
3154 pixel.red = show1 * radial;
3155 pixel.green = 0;
3156 pixel.blue = 0;
3157
3158 pixel = rgb_sanity_check(pixel);
3159
3160 setPixelColorInternal(x, y, pixel);
3161 }
3162 }
3163 }
3164
3165 void Complex_Kaleido_6() {
3166
3167 get_ready();
3168
3169 timings.master_speed = 0.01; // master speed
3170
3171 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3172 // values = faster transitions
3173 timings.ratio[1] = 0.027;
3174 timings.ratio[2] = 0.031;
3175 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3176 // values = faster transitions
3177 timings.ratio[4] = 0.037;
3178 timings.ratio[5] = 0.0038;
3179 timings.ratio[6] = 0.041;
3180
3181 calculate_oscillators(timings);
3182
3183 for (int x = 0; x < num_x; x++) {
3184 for (int y = 0; y < num_y; y++) {
3185
3186 animation.dist = distance[x][y];
3187 animation.angle = 16 * polar_theta[x][y] + 16 * move.radial[0];
3188 animation.z = 5;
3189 animation.scale_x = 0.06;
3190 animation.scale_y = 0.06;
3191 animation.offset_z = -10 * move.linear[0];
3192 animation.offset_y = 10 * move.noise_angle[0];
3193 animation.offset_x = 10 * move.noise_angle[4];
3194 animation.low_limit = 0;
3195 show1 = render_value(animation);
3196
3197 animation.dist = distance[x][y];
3198 animation.angle = 16 * polar_theta[x][y] + 16 * move.radial[1];
3199 animation.z = 500;
3200 animation.scale_x = 0.06;
3201 animation.scale_y = 0.06;
3202 animation.offset_z = -10 * move.linear[1];
3203 animation.offset_y = 10 * move.noise_angle[1];
3204 animation.offset_x = 10 * move.noise_angle[3];
3205 animation.low_limit = 0;
3206 show2 = render_value(animation);
3207
3208 // float radius = radial_filter_radius; // radius of a radial
3209 // brightness filter float radial =
3210 // (radius-distance[x][y])/distance[x][y];
3211
3212 pixel.red = show1;
3213 pixel.green = 0;
3214 pixel.blue = show2;
3215
3216 pixel = rgb_sanity_check(pixel);
3217
3218 setPixelColorInternal(x, y, pixel);
3219 }
3220 }
3221 }
3222
3223 void Water() {
3224
3225 get_ready();
3226
3227 timings.master_speed = 0.037; // master speed
3228
3229 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3230 // values = faster transitions
3231 timings.ratio[1] = 0.027;
3232 timings.ratio[2] = 0.031;
3233 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3234 // values = faster transitions
3235 timings.ratio[4] = 0.037;
3236 timings.ratio[5] = 0.1;
3237 timings.ratio[6] = 0.41;
3238
3239 calculate_oscillators(timings);
3240
3241 for (int x = 0; x < num_x; x++) {
3242 for (int y = 0; y < num_y; y++) {
3243
3244 animation.dist =
3245 distance[x][y] +
3246 4 * sinf(move.directional[5] * PI + (float)x / 2) +
3247 4 * cosf(move.directional[6] * PI + float(y) / 2);
3248 animation.angle = 1 * polar_theta[x][y];
3249 animation.z = 5;
3250 animation.scale_x = 0.06;
3251 animation.scale_y = 0.06;
3252 animation.offset_z = -10 * move.linear[0];
3253 animation.offset_y = 10;
3254 animation.offset_x = 10;
3255 animation.low_limit = 0;
3256 show1 = render_value(animation);
3257
3258 animation.dist = (10 + move.directional[0]) *
3259 sinf(-move.radial[5] + move.radial[0] +
3260 (distance[x][y] / (3)));
3261 animation.angle = 1 * polar_theta[x][y];
3262 animation.z = 5;
3263 animation.scale_x = 0.1;
3264 animation.scale_y = 0.1;
3265 animation.offset_z = -10;
3266 animation.offset_y = 20 * move.linear[0];
3267 animation.offset_x = 10;
3268 animation.low_limit = 0;
3269 show2 = render_value(animation);
3270
3271 animation.dist = (10 + move.directional[1]) *
3272 sinf(-move.radial[5] + move.radial[1] +
3273 (distance[x][y] / (3)));
3274 animation.angle = 1 * polar_theta[x][y];
3275 animation.z = 500;
3276 animation.scale_x = 0.1;
3277 animation.scale_y = 0.1;
3278 animation.offset_z = -10;
3279 animation.offset_y = 20 * move.linear[1];
3280 animation.offset_x = 10;
3281 animation.low_limit = 0;
3282 show3 = render_value(animation);
3283
3284 animation.dist = (10 + move.directional[2]) *
3285 sinf(-move.radial[5] + move.radial[2] +
3286 (distance[x][y] / (3)));
3287 animation.angle = 1 * polar_theta[x][y];
3288 animation.z = 500;
3289 animation.scale_x = 0.1;
3290 animation.scale_y = 0.1;
3291 animation.offset_z = -10;
3292 animation.offset_y = 20 * move.linear[2];
3293 animation.offset_x = 10;
3294 animation.low_limit = 0;
3295 show4 = render_value(animation);
3296
3297 // float radius = radial_filter_radius; // radius of a radial
3298 // brightness filter float radial =
3299 // (radius-distance[x][y])/distance[x][y];
3300
3301 // pixel.red = show2;
3302
3303 pixel.blue = (0.7 * show2 + 0.6 * show3 + 0.5 * show4);
3304 pixel.red = pixel.blue - 40;
3305 pixel.green = 0;
3306 // pixel.red = radial*show3;
3307 // pixel.green = 0.9*radial*show4;
3308
3309 pixel = rgb_sanity_check(pixel);
3310
3311 setPixelColorInternal(x, y, pixel);
3312 }
3313 }
3314 }
3315
3316 void Parametric_Water() {
3317
3318 get_ready();
3319
3320 timings.master_speed = 0.003; // master speed
3321
3322 timings.ratio[0] = 0.025; // speed ratios for the oscillators, higher
3323 // values = faster transitions
3324 timings.ratio[1] = 0.027;
3325 timings.ratio[2] = 0.029;
3326 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3327 // values = faster transitions
3328 timings.ratio[4] = 0.037;
3329 timings.ratio[5] = 0.15; // wave speed
3330 timings.ratio[6] = 0.41;
3331
3332 calculate_oscillators(timings);
3333
3334 for (int x = 0; x < num_x; x++) {
3335 for (int y = 0; y < num_y; y++) {
3336
3337 float s = 4;
3338 float f = 10 + 2 * move.directional[0];
3339
3340 animation.dist = (f + move.directional[0]) *
3341 sinf(-move.radial[5] + move.radial[0] +
3342 (distance[x][y] / (s)));
3343 animation.angle = 1 * polar_theta[x][y];
3344 animation.z = 5;
3345 animation.scale_x = 0.1;
3346 animation.scale_y = 0.1;
3347 animation.offset_z = -10;
3348 animation.offset_y = 20 * move.linear[0];
3349 animation.offset_x = 10;
3350 animation.low_limit = 0;
3351 show2 = render_value(animation);
3352
3353 animation.dist = (f + move.directional[1]) *
3354 sinf(-move.radial[5] + move.radial[1] +
3355 (distance[x][y] / (s)));
3356 animation.angle = 1 * polar_theta[x][y];
3357 animation.z = 500;
3358 animation.scale_x = 0.1;
3359 animation.scale_y = 0.1;
3360 animation.offset_z = -10;
3361 animation.offset_y = 20 * move.linear[1];
3362 animation.offset_x = 10;
3363 animation.low_limit = 0;
3364 show3 = render_value(animation);
3365
3366 animation.dist = (f + move.directional[2]) *
3367 sinf(-move.radial[5] + move.radial[2] +
3368 (distance[x][y] / (s)));
3369 animation.angle = 1 * polar_theta[x][y];
3370 animation.z = 5000;
3371 animation.scale_x = 0.1;
3372 animation.scale_y = 0.1;
3373 animation.offset_z = -10;
3374 animation.offset_y = 20 * move.linear[2];
3375 animation.offset_x = 10;
3376 animation.low_limit = 0;
3377 show4 = render_value(animation);
3378
3379 animation.dist = (f + move.directional[3]) *
3380 sinf(-move.radial[5] + move.radial[3] +
3381 (distance[x][y] / (s)));
3382 animation.angle = 1 * polar_theta[x][y];
3383 animation.z = 2000;
3384 animation.scale_x = 0.1;
3385 animation.scale_y = 0.1;
3386 animation.offset_z = -10;
3387 animation.offset_y = 20 * move.linear[3];
3388 animation.offset_x = 10;
3389 animation.low_limit = 0;
3390 show5 = render_value(animation);
3391
3392 show6 = screen(show4, show5);
3393 show7 = screen(show2, show3);
3394
3395 float radius = 40; // radius of a radial brightness filter
3396 float radial = (radius - distance[x][y]) / radius;
3397
3398 // pixel.red = show6;
3399 // pixel.blue = show7;
3400
3401 pixel.red = pixel.blue - 40;
3402 pixel.green = 0;
3403 pixel.blue = (0.3 * show6 + 0.7 * show7) * radial;
3404
3405 pixel = rgb_sanity_check(pixel);
3406
3407 setPixelColorInternal(x, y, pixel);
3408 }
3409 }
3410 }
3411
3412 void Module_Experiment1() {
3413
3414 get_ready();
3415
3416 timings.master_speed = 0.03; // master speed
3417
3418 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3419 // values = faster transitions
3420 timings.ratio[1] = 0.0027;
3421 timings.ratio[2] = 0.029;
3422 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3423 // values = faster transitions
3424
3425 calculate_oscillators(timings);
3426
3427 for (int x = 0; x < num_x; x++) {
3428 for (int y = 0; y < num_y; y++) {
3429
3430 animation.dist = distance[x][y] + 20 * move.directional[0];
3431 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3432 polar_theta[x][y];
3433 animation.z = 5;
3434 animation.scale_x = 0.1;
3435 animation.scale_y = 0.1;
3436 animation.offset_z = -10;
3437 animation.offset_y = 20 * move.linear[2];
3438 animation.offset_x = 10;
3439 animation.low_limit = 0;
3440 show1 = render_value(animation);
3441
3442 pixel.red = 0;
3443 pixel.green = 0;
3444 pixel.blue = show1;
3445
3446 pixel = rgb_sanity_check(pixel);
3447
3448 setPixelColorInternal(x, y, pixel);
3449 }
3450 }
3451 }
3452
3453 void Module_Experiment2() {
3454
3455 get_ready();
3456
3457 timings.master_speed = 0.02; // master speed
3458
3459 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3460 // values = faster transitions
3461 timings.ratio[1] = 0.0027;
3462 timings.ratio[2] = 0.029;
3463 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3464 // values = faster transitions
3465
3466 calculate_oscillators(timings);
3467
3468 for (int x = 0; x < num_x; x++) {
3469 for (int y = 0; y < num_y; y++) {
3470
3471 animation.dist =
3472 distance[x][y] - (16 + move.directional[0] * 16);
3473 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3474 polar_theta[x][y];
3475 animation.z = 5;
3476 animation.scale_x = 0.1;
3477 animation.scale_y = 0.1;
3478 animation.offset_z = -10;
3479 animation.offset_y = 20 * move.linear[2];
3480 animation.offset_x = 10;
3481 animation.low_limit = 0;
3482 show1 = render_value(animation);
3483
3484 pixel.red = show1;
3485 pixel.green = show1 - 80;
3486 pixel.blue = show1 - 150;
3487
3488 pixel = rgb_sanity_check(pixel);
3489
3490 setPixelColorInternal(x, y, pixel);
3491 }
3492 }
3493 }
3494
3495 void Module_Experiment3() {
3496
3497 get_ready();
3498
3499 timings.master_speed = 0.01; // master speed
3500
3501 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3502 // values = faster transitions
3503 timings.ratio[1] = 0.0027;
3504 timings.ratio[2] = 0.029;
3505 timings.ratio[3] = 0.033; // speed ratios for the oscillators, higher
3506 // values = faster transitions
3507
3508 calculate_oscillators(timings);
3509
3510 for (int x = 0; x < num_x; x++) {
3511 for (int y = 0; y < num_y; y++) {
3512
3513 animation.dist =
3514 distance[x][y] - (12 + move.directional[3] * 4);
3515 animation.angle = move.noise_angle[0] + move.noise_angle[1] +
3516 polar_theta[x][y];
3517 animation.z = 5;
3518 animation.scale_x = 0.1;
3519 animation.scale_y = 0.1;
3520 animation.offset_z = -10;
3521 animation.offset_y = 20 * move.linear[2];
3522 animation.offset_x = 10;
3523 animation.low_limit = 0;
3524 show1 = render_value(animation);
3525
3526 pixel.red = show1;
3527 pixel.green = show1 - 80;
3528 pixel.blue = show1 - 150;
3529
3530 pixel = rgb_sanity_check(pixel);
3531
3532 setPixelColorInternal(x, y, pixel);
3533 }
3534 }
3535 }
3536
3537 void Zoom2() { // nice one
3538
3539 get_ready();
3540
3541 run_default_oscillators();
3542 timings.master_speed = 0.003;
3543 calculate_oscillators(timings);
3544
3545 for (int x = 0; x < num_x; x++) {
3546 for (int y = 0; y < num_y; y++) {
3547
3548 animation.dist = (distance[x][y] * distance[x][y]) / 2;
3549 animation.angle = polar_theta[x][y];
3550
3551 animation.scale_x = 0.005;
3552 animation.scale_y = 0.005;
3553
3554 animation.offset_y = -10 * move.linear[0];
3555 animation.offset_x = 0;
3556 animation.offset_z = 0.1 * move.linear[0];
3557
3558 animation.z = 0;
3559 animation.low_limit = 0;
3560 float show1 = render_value(animation);
3561
3562 // float linear = 1;//(y+1)/(num_y-1.f);
3563
3564 pixel.red = show1;
3565 pixel.green = 0;
3566 pixel.blue = 40 - show1;
3567
3568 pixel = rgb_sanity_check(pixel);
3569 setPixelColorInternal(y, x, pixel);
3570 }
3571 }
3572 }
3573
3574 void Module_Experiment4() {
3575
3576 get_ready();
3577
3578 timings.master_speed = 0.031; // master speed
3579
3580 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3581 // values = faster transitions
3582 timings.ratio[1] = 0.0027;
3583 timings.ratio[2] = 0.029;
3584 timings.ratio[3] = 0.033;
3585 timings.ratio[4] = 0.036; // speed ratios for the oscillators, higher
3586 // values = faster transitions
3587
3588 calculate_oscillators(timings);
3589
3590 for (int x = 0; x < num_x; x++) {
3591 for (int y = 0; y < num_y; y++) {
3592
3593 float s = 0.8;
3594
3595 animation.dist = (distance[x][y] * distance[x][y]) * 0.7;
3596 animation.angle = polar_theta[x][y];
3597 animation.z = 5;
3598 animation.scale_x = 0.004 * s;
3599 animation.scale_y = 0.003 * s;
3600 animation.offset_z = 0.1 * move.linear[2];
3601 animation.offset_y = -20 * move.linear[2];
3602 animation.offset_x = 10;
3603 animation.low_limit = 0;
3604 show1 = render_value(animation);
3605
3606 animation.dist = (distance[x][y] * distance[x][y]) * 0.8;
3607 animation.angle = polar_theta[x][y];
3608 animation.z = 50;
3609 animation.scale_x = 0.004 * s;
3610 animation.scale_y = 0.003 * s;
3611 animation.offset_z = 0.1 * move.linear[3];
3612 animation.offset_y = -20 * move.linear[3];
3613 animation.offset_x = 100;
3614 animation.low_limit = 0;
3615 show2 = render_value(animation);
3616
3617 animation.dist = (distance[x][y] * distance[x][y]) * 0.9;
3618 animation.angle = polar_theta[x][y];
3619 animation.z = 5000;
3620 animation.scale_x = 0.004 * s;
3621 animation.scale_y = 0.003 * s;
3622 animation.offset_z = 0.1 * move.linear[4];
3623 animation.offset_y = -20 * move.linear[4];
3624 animation.offset_x = 1000;
3625 animation.low_limit = 0;
3626 show3 = render_value(animation);
3627
3628 // overlapping color mapping
3629 /*
3630 float r = show1;
3631 float g = show2-show1;
3632 float b = show3-show1-show2;
3633 */
3634
3635 pixel.red = show1 - show2 - show3;
3636 pixel.blue = show2 - show1 - show3;
3637 pixel.green = show3 - show1 - show2;
3638 // pixel.green = b;
3639 // pixel.green = show1 - 80;
3640 // pixel.blue = show1 - 150;
3641
3642 pixel = rgb_sanity_check(pixel);
3643
3644 setPixelColorInternal(x, y, pixel);
3645 }
3646 }
3647 }
3648
3649 void Module_Experiment5() {
3650
3651 get_ready();
3652
3653 timings.master_speed = 0.031; // master speed
3654
3655 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3656 // values = faster transitions
3657 timings.ratio[1] = 0.0027;
3658 timings.ratio[2] = 0.029;
3659 timings.ratio[3] = 0.33;
3660 timings.ratio[4] = 0.036; // speed ratios for the oscillators, higher
3661 // values = faster transitions
3662
3663 calculate_oscillators(timings);
3664
3665 for (int x = 0; x < num_x; x++) {
3666 for (int y = 0; y < num_y; y++) {
3667
3668 float s = 1.5;
3669
3670 animation.dist = distance[x][y] +
3671 sinf(0.5 * distance[x][y] - move.radial[3]);
3672 animation.angle = polar_theta[x][y];
3673 animation.z = 5;
3674 animation.scale_x = 0.1 * s;
3675 animation.scale_y = 0.1 * s;
3676 animation.offset_z = 0.1 * move.linear[0];
3677 animation.offset_y = -20 * move.linear[0];
3678 animation.offset_x = 10;
3679 animation.low_limit = 0;
3680 show1 = render_value(animation);
3681
3682 pixel.red = show1;
3683 pixel.green = 0;
3684 pixel.blue = 0;
3685
3686 pixel = rgb_sanity_check(pixel);
3687
3688 setPixelColorInternal(x, y, pixel);
3689 }
3690 }
3691 }
3692
3693 void Module_Experiment6() {
3694
3695 get_ready();
3696
3697 timings.master_speed = 0.01; // master speed 0.031
3698
3699 float w = 0.7;
3700
3701 timings.ratio[0] = 0.0025; // speed ratios for the oscillators, higher
3702 // values = faster transitions
3703 timings.ratio[1] = 0.0027;
3704 timings.ratio[2] = 0.029;
3705 timings.ratio[3] = 0.33 * w;
3706 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3707 // values = faster transitions
3708
3709 calculate_oscillators(timings);
3710
3711 for (int x = 0; x < num_x; x++) {
3712 for (int y = 0; y < num_y; y++) {
3713
3714 float s = 0.8;
3715
3716 animation.dist = distance[x][y] +
3717 sinf(0.25 * distance[x][y] - move.radial[3]);
3718 animation.angle = polar_theta[x][y];
3719 animation.z = 5;
3720 animation.scale_x = 0.1 * s;
3721 animation.scale_y = 0.1 * s;
3722 animation.offset_z = 0.1 * move.linear[0];
3723 animation.offset_y = -20 * move.linear[0];
3724 animation.offset_x = 10;
3725 animation.low_limit = 0;
3726 show1 = render_value(animation);
3727
3728 animation.dist = distance[x][y] +
3729 sinf(0.24 * distance[x][y] - move.radial[4]);
3730 animation.angle = polar_theta[x][y];
3731 animation.z = 10;
3732 animation.scale_x = 0.1 * s;
3733 animation.scale_y = 0.1 * s;
3734 animation.offset_z = 0.1 * move.linear[1];
3735 animation.offset_y = -20 * move.linear[1];
3736 animation.offset_x = 10;
3737 animation.low_limit = 0;
3738 show2 = render_value(animation);
3739
3740 /*
3741 pixel.red = show1;
3742 pixel.green = show1 * 0.3;
3743 pixel.blue = show2-show1;
3744 */
3745
3746 pixel.red = (show1 + show2);
3747 pixel.green = ((show1 + show2) * 0.6) - 30;
3748 pixel.blue = 0;
3749
3750 pixel = rgb_sanity_check(pixel);
3751
3752 setPixelColorInternal(x, y, pixel);
3753 }
3754 }
3755 }
3756
3757 void Module_Experiment7() {
3758
3759 get_ready();
3760
3761 timings.master_speed = 0.005; // master speed 0.031
3762
3763 float w = 0.3;
3764
3765 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3766 // values = faster transitions
3767 timings.ratio[1] = 0.011;
3768 timings.ratio[2] = 0.029;
3769 timings.ratio[3] = 0.33 * w;
3770 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3771 // values = faster transitions
3772
3773 calculate_oscillators(timings);
3774
3775 for (int x = 0; x < num_x; x++) {
3776 for (int y = 0; y < num_y; y++) {
3777
3778 float s = 0.7;
3779
3780 animation.dist =
3781 2 + distance[x][y] +
3782 2 * sinf(0.25 * distance[x][y] - move.radial[3]);
3783 animation.angle = polar_theta[x][y];
3784 animation.z = 5;
3785 animation.scale_x = 0.1 * s;
3786 animation.scale_y = 0.1 * s;
3787 animation.offset_z = 10 * move.linear[0];
3788 animation.offset_y = -20 * move.linear[0];
3789 animation.offset_x = 10;
3790 animation.low_limit = 0;
3791 show1 = render_value(animation);
3792
3793 animation.dist =
3794 2 + distance[x][y] +
3795 2 * sinf(0.24 * distance[x][y] - move.radial[4]);
3796 animation.angle = polar_theta[x][y];
3797 animation.z = 10;
3798 animation.scale_x = 0.1 * s;
3799 animation.scale_y = 0.1 * s;
3800 animation.offset_z = 0.1 * move.linear[1];
3801 animation.offset_y = -20 * move.linear[1];
3802 animation.offset_x = 10;
3803 animation.low_limit = 0;
3804 show2 = render_value(animation);
3805
3806 /*
3807 pixel.red = show1;
3808 pixel.green = show1 * 0.3;
3809 pixel.blue = show2-show1;
3810 */
3811
3812 pixel.red = (show1 + show2);
3813 pixel.green = ((show1 + show2) * 0.6) - 50;
3814 pixel.blue = 0;
3815
3816 pixel = rgb_sanity_check(pixel);
3817
3818 setPixelColorInternal(x, y, pixel);
3819 }
3820 }
3821 }
3822
3823 void Module_Experiment8() {
3824
3825 get_ready();
3826
3827 timings.master_speed = 0.01; // master speed 0.031
3828
3829 float w = 0.3;
3830
3831 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3832 // values = faster transitions
3833 timings.ratio[1] = 0.011;
3834 timings.ratio[2] = 0.013;
3835 timings.ratio[3] = 0.33 * w;
3836 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3837 // values = faster transitions
3838 timings.ratio[5] = 0.38 * w;
3839 timings.ratio[6] = 0.0003; // master rotation
3840
3841 timings.offset[0] = 0;
3842 timings.offset[1] = 100;
3843 timings.offset[2] = 200;
3844 timings.offset[3] = 300;
3845 timings.offset[4] = 400;
3846 timings.offset[5] = 500;
3847 timings.offset[6] = 600;
3848
3849 calculate_oscillators(timings);
3850
3851 for (int x = 0; x < num_x; x++) {
3852 for (int y = 0; y < num_y; y++) {
3853
3854 float s = 0.4; // scale
3855 float r = 1.5; // scroll speed
3856
3857 animation.dist =
3858 3 + distance[x][y] +
3859 3 * sinf(0.25 * distance[x][y] - move.radial[3]);
3860 animation.angle = polar_theta[x][y] + move.noise_angle[0] +
3861 move.noise_angle[6];
3862 animation.z = 5;
3863 animation.scale_x = 0.1 * s;
3864 animation.scale_y = 0.1 * s;
3865 animation.offset_z = 10 * move.linear[0];
3866 animation.offset_y = -5 * r * move.linear[0];
3867 animation.offset_x = 10;
3868 animation.low_limit = 0;
3869 show1 = render_value(animation);
3870
3871 animation.dist =
3872 4 + distance[x][y] +
3873 4 * sinf(0.24 * distance[x][y] - move.radial[4]);
3874 animation.angle = polar_theta[x][y] + move.noise_angle[1] +
3875 move.noise_angle[6];
3876 animation.z = 5;
3877 animation.scale_x = 0.1 * s;
3878 animation.scale_y = 0.1 * s;
3879 animation.offset_z = 0.1 * move.linear[1];
3880 animation.offset_y = -5 * r * move.linear[1];
3881 animation.offset_x = 100;
3882 animation.low_limit = 0;
3883 show2 = render_value(animation);
3884
3885 animation.dist =
3886 5 + distance[x][y] +
3887 5 * sinf(0.23 * distance[x][y] - move.radial[5]);
3888 animation.angle = polar_theta[x][y] + move.noise_angle[2] +
3889 move.noise_angle[6];
3890 animation.z = 5;
3891 animation.scale_x = 0.1 * s;
3892 animation.scale_y = 0.1 * s;
3893 animation.offset_z = 0.1 * move.linear[2];
3894 animation.offset_y = -5 * r * move.linear[2];
3895 animation.offset_x = 1000;
3896 animation.low_limit = 0;
3897 show3 = render_value(animation);
3898
3899 show4 = colordodge(show1, show2);
3900
3901 float rad = sinf(PI / 2 +
3902 distance[x][y] / 14); // better radial filter?!
3903
3904 /*
3905 pixel.red = show1;
3906 pixel.green = show1 * 0.3;
3907 pixel.blue = show2-show1;
3908 */
3909
3910 pixel.red = rad * ((show1 + show2) + show3);
3911 pixel.green = (((show2 + show3) * 0.8) - 90) * rad;
3912 pixel.blue = show4 * 0.2;
3913
3914 pixel = rgb_sanity_check(pixel);
3915
3916 setPixelColorInternal(x, y, pixel);
3917 }
3918 }
3919 }
3920
3921 void Module_Experiment9() {
3922
3923 get_ready();
3924
3925 timings.master_speed = 0.03; // master speed 0.031
3926
3927 float w = 0.3;
3928
3929 timings.ratio[0] = 0.1; // speed ratios for the oscillators, higher
3930 // values = faster transitions
3931 timings.ratio[1] = 0.011;
3932 timings.ratio[2] = 0.013;
3933 timings.ratio[3] = 0.33 * w;
3934 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3935 // values = faster transitions
3936 timings.ratio[5] = 0.38 * w;
3937 timings.ratio[6] = 0.0003;
3938
3939 calculate_oscillators(timings);
3940
3941 for (int x = 0; x < num_x; x++) {
3942 for (int y = 0; y < num_y; y++) {
3943
3944 animation.dist = distance[x][y];
3945 animation.angle = polar_theta[x][y] + move.radial[1];
3946 animation.z = 5;
3947 animation.scale_x = 0.001;
3948 animation.scale_y = 0.1;
3949 animation.scale_z = 0.1;
3950 animation.offset_y = -10 * move.linear[0];
3951 animation.offset_x = 20;
3952 animation.offset_z = 10;
3953 animation.low_limit = 0;
3954 show1 = render_value(animation);
3955
3956 pixel.red = 10 * show1;
3957 pixel.green = 0;
3958 pixel.blue = 0;
3959
3960 pixel = rgb_sanity_check(pixel);
3961
3962 setPixelColorInternal(x, y, pixel);
3963 }
3964 }
3965 }
3966
3967 void Module_Experiment10() {
3968
3969 get_ready();
3970
3971 timings.master_speed = 0.01; // master speed 0.031
3972
3973 float w = 1;
3974
3975 timings.ratio[0] = 0.01; // speed ratios for the oscillators, higher
3976 // values = faster transitions
3977 timings.ratio[1] = 0.011;
3978 timings.ratio[2] = 0.013;
3979 timings.ratio[3] = 0.33 * w;
3980 timings.ratio[4] = 0.36 * w; // speed ratios for the oscillators, higher
3981 // values = faster transitions
3982 timings.ratio[5] = 0.38 * w;
3983 timings.ratio[6] = 0.0003; // master rotation
3984
3985 timings.offset[0] = 0;
3986 timings.offset[1] = 100;
3987 timings.offset[2] = 200;
3988 timings.offset[3] = 300;
3989 timings.offset[4] = 400;
3990 timings.offset[5] = 500;
3991 timings.offset[6] = 600;
3992
3993 calculate_oscillators(timings);
3994
3995 for (int x = 0; x < num_x; x++) {
3996 for (int y = 0; y < num_y; y++) {
3997
3998 float s = 0.4; // scale
3999 float r = 1.5; // scroll speed
4000
4001 animation.dist =
4002 3 + distance[x][y] +
4003 3 * sinf(0.25 * distance[x][y] - move.radial[3]);
4004 animation.angle = polar_theta[x][y] + move.noise_angle[0] +
4005 move.noise_angle[6];
4006 animation.z = 5;
4007 animation.scale_x = 0.1 * s;
4008 animation.scale_y = 0.1 * s;
4009 animation.offset_z = 10 * move.linear[0];
4010 animation.offset_y = -5 * r * move.linear[0];
4011 animation.offset_x = 10;
4012 animation.low_limit = 0;
4013 show1 = render_value(animation);
4014
4015 animation.dist =
4016 4 + distance[x][y] +
4017 4 * sinf(0.24 * distance[x][y] - move.radial[4]);
4018 animation.angle = polar_theta[x][y] + move.noise_angle[1] +
4019 move.noise_angle[6];
4020 animation.z = 5;
4021 animation.scale_x = 0.1 * s;
4022 animation.scale_y = 0.1 * s;
4023 animation.offset_z = 0.1 * move.linear[1];
4024 animation.offset_y = -5 * r * move.linear[1];
4025 animation.offset_x = 100;
4026 animation.low_limit = 0;
4027 show2 = render_value(animation);
4028
4029 animation.dist =
4030 5 + distance[x][y] +
4031 5 * sinf(0.23 * distance[x][y] - move.radial[5]);
4032 animation.angle = polar_theta[x][y] + move.noise_angle[2] +
4033 move.noise_angle[6];
4034 animation.z = 5;
4035 animation.scale_x = 0.1 * s;
4036 animation.scale_y = 0.1 * s;
4037 animation.offset_z = 0.1 * move.linear[2];
4038 animation.offset_y = -5 * r * move.linear[2];
4039 animation.offset_x = 1000;
4040 animation.low_limit = 0;
4041 show3 = render_value(animation);
4042
4043 show4 = colordodge(show1, show2);
4044
4045 float rad = sinf(PI / 2 +
4046 distance[x][y] / 14); // better radial filter?!
4047
4048 /*
4049 pixel.red = show1;
4050 pixel.green = show1 * 0.3;
4051 pixel.blue = show2-show1;
4052 */
4053
4054 CHSV(rad * ((show1 + show2) + show3), 255, 255);
4055
4056 pixel = rgb_sanity_check(pixel);
4057
4058 uint8_t a = getTime() / 100;
4059 CRGB p = CRGB(CHSV(((a + show1 + show2) + show3), 255, 255));
4060 rgb pixel;
4061 pixel.red = p.red;
4062 pixel.green = p.green;
4063 pixel.blue = p.blue;
4064 setPixelColorInternal(x, y, pixel);
4065 }
4066 }
4067 }
4068};
4069
4070} // namespace animartrix_detail
void setSpeedFactor(float speed)
Set the Speed Factor 0.1 to 10 - 1 for original speed.
uint8_t red
Red channel value.
Definition crgb.h:44
uint8_t blue
Blue channel value.
Definition crgb.h:52
uint8_t green
Green channel value.
Definition crgb.h:48
#define P(x)
Reads a single byte from the p array.
Definition noise.cpp:42
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:11
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:39