From e886c85134d49cb37921c700f394558e0ded7687 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sun, 30 Apr 2023 13:25:08 +0200 Subject: [PATCH] Tweaks. --- wled00/FX.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 0f04810e..b2731166 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7520,7 +7520,7 @@ uint16_t mode_2Doctopus() { map_t *rMap = reinterpret_cast(SEGENV.data); if (SEGENV.call == 0) { - SEGENV.aux0 = 0; // t + SEGENV.step = 0; // t for (int x = -C_X; x < C_X + (cols % 2); x++) { for (int y = -C_Y; y < C_Y + (rows % 2); y++) { rMap[XY(x + C_X, y + C_Y)].angle = 128 * (atan2f(y, x) / PI); @@ -7529,15 +7529,15 @@ uint16_t mode_2Doctopus() { } } - SEGENV.aux0 += SEGMENT.speed / 32 + 1; // 1-8 range - for (uint8_t x = 0; x < cols; x++) { - for (uint8_t y = 0; y < rows; y++) { + SEGENV.step += SEGMENT.speed / 32 + 1; // 1-4 range + for (int x = 0; x < cols; x++) { + for (int y = 0; y < rows; y++) { byte angle = rMap[XY(x,y)].angle; byte radius = rMap[XY(x,y)].radius; - //CRGB c = CHSV(SEGENV.aux0 / 2 - radius, 255, sin8(sin8((angle * 4 - radius) / 4 + SEGENV.aux0) + radius - SEGENV.aux0 * 2 + angle * (SEGMENT.custom3/3+1))); - uint16_t intensity = sin8(sin8((angle * 4 - radius) / 4 + SEGENV.aux0/2) + radius - SEGENV.aux0 + angle * (SEGMENT.custom3/4+1)); - intensity = map(intensity*intensity, 0, 65535, 0, SEGMENT.intensity); // add a bit of non-linearity to brightness - CRGB c = ColorFromPalette(SEGPALETTE, SEGENV.aux0 / 2 - radius, intensity); + //CRGB c = CHSV(SEGENV.step / 2 - radius, 255, sin8(sin8((angle * 4 - radius) / 4 + SEGENV.step) + radius - SEGENV.step * 2 + angle * (SEGMENT.custom3/3+1))); + uint16_t intensity = sin8(sin8((angle * 4 - radius) / 4 + SEGENV.step/2) + radius - SEGENV.step + angle * (SEGMENT.custom3/4+1)); + intensity = map(intensity*intensity, 0, 65535, 0, SEGMENT.intensity); // add a bit of non-linearity for cleaner display + CRGB c = ColorFromPalette(SEGPALETTE, SEGENV.step / 2 - radius, intensity); SEGMENT.setPixelColorXY(x, y, c); } } @@ -7555,13 +7555,16 @@ uint16_t mode_2Dwavingcell() { const uint16_t cols = SEGMENT.virtualWidth(); const uint16_t rows = SEGMENT.virtualHeight(); - uint32_t t = millis()/(256-SEGMENT.speed); + uint32_t t = millis()/(257-SEGMENT.speed); + uint8_t aX = SEGMENT.custom1/16 + 9; + uint8_t aY = SEGMENT.custom2/16 + 1; + uint8_t aZ = SEGMENT.custom3 + 1; for (int x = 0; x < cols; x++) for (int y = 0; y