Skip to content

Commit

Permalink
minor FX improvements
Browse files Browse the repository at this point in the history
Fire2012: better randomness
Julia: avoid darkening when using "blur"
  • Loading branch information
softhack007 committed Dec 3, 2024
1 parent 796eb6e commit f2f621b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,12 +2128,16 @@ uint16_t mode_fire_2012() {

const uint8_t ignition = max(3,SEGLEN/10); // ignition area: 10% of segment length or minimum 3 pixels

#if defined(ARDUINO_ARCH_ESP32)
random16_add_entropy(esp_random() & 0xFFFF); // improves randonmess
#endif

// Step 1. Cool down every cell a little
for (int i = 0; i < SEGLEN; i++) {
uint8_t cool = (it != SEGENV.step) ? random8((((20 + SEGMENT.speed/3) * 16) / SEGLEN)+2) : random8(4);
uint8_t minTemp = (i<ignition) ? (ignition-i)/4 + 16 : 0; // should not become black in ignition area
uint8_t temp = qsub8(heat[i], cool);
heat[i] = temp<minTemp ? minTemp : temp;
heat[i] = max(minTemp, temp);
}

if (it != SEGENV.step) {
Expand Down Expand Up @@ -5706,6 +5710,7 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
float imAg;

if (SEGENV.call == 0) { // Reset the center if we've just re-started this animation.
SEGMENT.setUpLeds(); SEGMENT.fill(BLACK); // WLEDMM avoids dimming when blur option is selected
julias->xcen = 0.;
julias->ycen = 0.;
julias->xymag = 1.0;
Expand Down

0 comments on commit f2f621b

Please sign in to comment.