MoonModules / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi! MoonModules adds features on top of upstream.
https://mm.kno.wled.ge
European Union Public License 1.2
228 stars 70 forks source link

ghost pixels with "Use global LED buffer" #58

Open softhack007 opened 1 year ago

softhack007 commented 1 year ago

What happened?

The "Use global LED buffer" (LED preferences) option can add ghost pixels which are not there without global buffer.

To Reproduce Bug

It seems that "ingredients" are

Example:

GlobalLEDs_epic_fail

First Analysis

the "ghost pixels" are from the write to ledsrgb, which assumes wrong buffer coordinates; XY() is computed using segment boundaries only. As Segment#0 later uses "blur()", the global ledsrgb buffer pixels are used and ghost pixels appear next to the white text.

Conclusion

It seems we need a different XY() function for global buffer, as it must consider the "global" width instead of segment width. I think this new global_XY() needs to also use rotation and mirroring of a segment in the calculation.

Expected Behavior

Effects look (almost) the same, independent from using global buffer or not.

Install Method

Self-Compiled or other

What version/release of MM WLED?

any 0.14.0 build

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

This problem exists since "global buffer" was introduced in upstream WLED 0.14. We can either

To avoid wrong pixels, I would suggest to not use global buffer unless all segments have the same width as your overall layout. Without global buffer, there are no wrong pixels.

Code of Conduct