3D GEQ - make front brightness a control

This commit is contained in:
Will Tatam
2024-07-10 08:59:05 +01:00
parent 2d7e416879
commit 45f288a2f2

View File

@@ -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<linex+(cols/16);x++) {
// SEGMENT.drawLine(x,rows-1,x,rows-heights[i]-1,ledColor); // front fill
// }
// Faded fronts, assumes border added later.
// for (int x=linex+1; x<linex+(cols/16)-1;x++) {
// SEGMENT.drawLine(x,rows-2,x,rows-heights[i]-2,color_fade(ledColor,64,true)); // front fill
// }
// "Negative Space" - draw pure black fronts
for (int x=linex; x<linex+(cols/16);x++) {
SEGMENT.drawLine(x,rows-1,x,rows-heights[i]-1,BLACK); // front fill
if(frontBrightness > 250) {
// Full bright fronts, fills all front face.
for (int x=linex; x<linex+(cols/16);x++) {
SEGMENT.drawLine(x,rows-1,x,rows-heights[i]-1,ledColor); // front fill
}
}
else if(frontBrightness >= 50) {
// Faded fronts, assumes border added later.
for (int x=linex+1; x<linex+(cols/16)-1;x++) {
SEGMENT.drawLine(x,rows-2,x,rows-heights[i]-2,color_fade(ledColor,64,true)); // front fill
}
}
else {
// "Negative Space" - draw pure black fronts
for (int x=linex; x<linex+(cols/16);x++) {
SEGMENT.drawLine(x,rows-1,x,rows-heights[i]-1,BLACK); // front fill
}
}
if(frontBrightness >= 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