Repository navigation
2D effect bugfixes for large panels - #5908
softhack007 wants to merge 16 commits into
Conversation
* Crazy Bee: keep bees on track by avoiding int8 math * DNA Spiral: fix effect freeze when width >= 128 * Colored Bursts: Use full panel when width >= 128 * Rotozoomer: Use full panel when width >= 128
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
WalkthroughThe changes add Changes2D effect arithmetic
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🔵 Low · up to
|
as suggested by @DedeHai
* adjusted scaling parameters to avoid going out-of-bounds * limit effect speed on large panels (was depending on pixel count) * parameter tuning for larger panels, to make the effect look similar to smaller sizes
* solves undefined behavior from mixing signed and unsigned math * replace abs8() with abs() * parameter tuning to create a bigger sun an large fixtures * previous look preserved up to 32x32 pixels
the "black center" was never showing in larger panels => parameters tuned so the effect looks better on >32x32. The values used come from experimenting - no idea how the math really works ....
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
forgot to replace this - the inner loop should use pixelCount instead of SEGENV.step. Slightly adjusted speedScale to compensate for _slower_ effect motion.
as suggested by the rabbit
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
avoid an effect freeze when the effect was temporarily suspended, for example by switching the "power icon" off and then back on
prevent effect freeze when timebase jumps
prevents short delay before effects start
Future support:For dimension 257, cols - 1 or rows - 1 is 256, but beatsin8_t converts highest to uint8_t, producing 0. Limit cols/rows to the maximum that beatsin8_t can handle. NB: replacing beatsin8_t with beatsin16_t did not work, it makes the effect look very boring.
|
Side note: width = 256 or height = 256 is possible in theorie, however it confuses the 2D panel setup. Event width=255 and offset=1 won't work; it causes 2D setup and segments to fall back into 1D mode. This might get fixed in a future PR. For now the practical upper limit in WLED is 240 pixels width/height, achievable with 15 ws2812b panels of 16x16 pixels (alternatively: 7 HUB75 panels 32x32 = 224), or with a mixed HUB75/ws2812b panel setup. |
| unsigned _scale = map(SEGMENT.intensity, 0, 255, 30, adjScale); | ||
| int _speed = map(SEGMENT.speed, 0, 255, 128, 16); | ||
| // size-based mappings | ||
| float adjustHeight = (rows > 32) ? 12.0f * 32.0f / rows : mapf(max(rows, 8), 8, 32, 28, 12); // scale height inversely for larger matrices |
There was a problem hiding this comment.
I dont think there is a need to use floats here, should be doable in integer math
There was a problem hiding this comment.
challenge accepted - I'll see if the inner loop can be done with adjustHeight converted to fixed point
There was a problem hiding this comment.
@DedeHai answer is yes - we can get rid of the float calculation in the inner loop. I need to test my idea on hardware, and will push something tomorrow.
* prevent timing overflow * prevent barHeight overflow * hide "peak dot" when peak fade = 255
Fixes several problems that were identified in #5903
byteandint8_t+ bigger sun on larger panels (WLED-MM backport)general improvements:
abs8()withabs()where possiblelerp16by8(uint16_t a, uint16_t b, uint8_t frac)to fastled-slimAI assistance: nothing. Just my squishy bio-brains.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes