Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.26k stars 109 forks source link

[BUG] Blending broken since 0.91 #484

Closed blutack closed 7 months ago

blutack commented 8 months ago

Bug report

The effect "blend" option has been broken since 0.91. I bisected all the public releases and 0.90 is the last release which has the correct blending behaviour.

Describe the bug

In 0.90 and previous releases, the "Plasma" effect has smooth transitions between colours by default (or when effectSettings->blend is true).

Since 0.91, the "Plasma" effect always looks like blend is set to false, whether using the default configuration or manually setting effectSettings->blend to true. The difference is visibly very obvious and pretty jarring. It also seems to affect other effects such as Checkboard. The display in these releases looks like when blend is set to false on earlier firmwares - the pixels switch between discrete pallette values and it all looks very quantized and ugly.

I have tried manually overriding the call to ColorFromPalette in Plasma from CRGB color = ColorFromPalette(settings->palette, value, 255, settings->blend ? LINEARBLEND : NOBLEND); to CRGB color = ColorFromPalette(settings->palette, value, 255U, LINEARBLEND); to determine if the issue was settings->blend not being correctly initialised/obeyed. However, this had no effect - so either ColorFromPalette has somehow borked or it's something further down the drawing stack below drawPixel.

Possibly the colour is getting downcast or something?

Additional information

To Reproduce

Steps to reproduce the behaviour:

1) Send the following API payload to the device to create a custom app with the "Plasma" effect: curl -v 'http://awtrix_clock.lan/api/custom?name=blank' -H 'content-type: application/json' -H 'accept: application/json, /;q=0.5' -d '{"effect":"Plasma"}'

2) Switch to the custom app using the buttons on the clock or the app.

3) Note that the plasma effect is not smooth

Expected behaviour

The pixels in the plasma effect should smoothly transition between colours.

Additional context

I like using the Plasma effect as a "screensaver" on my desk, so I create a "blank" custom app with no content except the "Plasma" effect.

blutack commented 7 months ago

It's just the auto-brightness - I can reproduce by covering the sensor. It's almost certainly a hardware limitation of the LED pixels at low brightness rather than any issue in the code.