From 45f288a2f2aa942543ee1a411fe5c629cdd64f59 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 10 Jul 2024 08:59:05 +0100 Subject: [PATCH] 3D GEQ - make front brightness a control --- wled00/FX.cpp | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 70163a1e..02d9efcf 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -8358,7 +8358,7 @@ static const char _data_FX_MODE_2DWAVINGCELL[] PROGMEM = "Waving Cell@!,,Amplitu uint16_t mode_3DGEQ(void) { // Author: @TroyHacks - + static uint16_t projector; static uint16_t projector_dir = 1; @@ -8441,6 +8441,7 @@ uint16_t mode_3DGEQ(void) { } + uint8_t frontBrightness = SEGMENT.custom1; for (int i=0; i<16; i++) { uint16_t colorIndex = map(cols/16*i, 0, cols-1, 0, 255); @@ -8450,35 +8451,41 @@ uint16_t mode_3DGEQ(void) { if (heights[i] > 1) { - // Full bright fronts, fills all front face. - // for (int x=linex; x 250) { + // Full bright fronts, fills all front face. + for (int x=linex; x= 50) { + // Faded fronts, assumes border added later. + for (int x=linex+1; x= 50) { // TODO: other values too? not sure exactly when we want the border // Border - // SEGMENT.drawLine(linex, rows-1,linex,rows-heights[i]-1,ledColor); // left side line - // SEGMENT.drawLine(linex+(cols/16)-1,rows-1,linex+(cols/16)-1,rows-heights[i]-1,ledColor); // right side line - // SEGMENT.drawLine(linex, rows-heights[i]-2,linex+(cols/16)-1,rows-heights[i]-2,ledColor); // top line - // SEGMENT.drawLine(linex, rows-1,linex+(cols/16)-1,rows-1,ledColor); // bottom line - + SEGMENT.drawLine(linex, rows-1,linex,rows-heights[i]-1,ledColor); // left side line + SEGMENT.drawLine(linex+(cols/16)-1,rows-1,linex+(cols/16)-1,rows-heights[i]-1,ledColor); // right side line + SEGMENT.drawLine(linex, rows-heights[i]-2,linex+(cols/16)-1,rows-heights[i]-2,ledColor); // top line + SEGMENT.drawLine(linex, rows-1,linex+(cols/16)-1,rows-1,ledColor); // bottom line } } + } + return FRAMETIME; } -static const char _data_FX_MODE_3DGEQ[] PROGMEM = "3D GEQ"; // TODO set Audio, 2D and controls etc +static const char _data_FX_MODE_3DGEQ[] PROGMEM = "3D GEQ☾@!,,Fill Front,,;;!;2"; // TODO set Audio, 2D and controls etc #endif // WLED_DISABLE_2D