Skip to content

Commit a792431

Browse files
committed
Matrix effect speedup
Typically, more than 50% of pixels are black. This optimization avoids to fade and rewrite already black pixels.
1 parent 598e0bc commit a792431

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wled00/FX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5314,7 +5314,7 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams.
53145314
if (row < rows-1) SEGMENT.setPixelColorXY(col, row+1, spawnColor);
53155315
} else {
53165316
// fade other pixels
5317-
SEGMENT.setPixelColorXY(col, row, pix.nscale8(fade));
5317+
if (pix != CRGB::Black) SEGMENT.setPixelColorXY(col, row, pix.nscale8(fade)); // optimization: don't fade black pixels
53185318
}
53195319
}
53205320
}

0 commit comments

Comments
 (0)