You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add the "blending" on brightness change to the list. I only tested that on 2D so far and it makes 2D setups unusable with anything other than "fade". I dont think anyone wants to go to base color every time the brightness changes.
edit:
it is the same in 1D. to reproduce: choose any effect other than solid, set to swipe right for example, change brightness.
I did some investigation on the "FPS limit not respected" issue. Printing out time intervals between service() shows it is correct. however, there seems something odd about transitions, FPS do drop a lot even if it is not an FX transition, for example I set the transition time to 5s, ran three "soap" FX in overlay (to stress the MCU more) and compared 0.15 to 0.16:
in 0.15 there is barely any change in FPS, in 0.16 it drops significantly. I can confirm this is happening only since the "blending styles" were merged. @softhack007 do you know what is going on here? may this be related to your update to FPS limit/timing handling? Unfortunately the commits are all over so I was not able to pin it to any commit.
The issue is actually not the frame delay, that stays constant and correct.
what may be at play is how old/new FX is treated during non-FX transitions. So far I was not able to decipher what exactly is going on but FPS drop suggests that effects are executed twice now where as in the old code it was not.
effects are executed twice now where as in the old code it was not.
That is correct and expected if you want to transition from one effect to another. Unfortunately if effect does not change it is still run twice as color/palette change may need rewriting LED data.
can it be skipped in fade mode?
The double-execution of course makes sense in other transition styles but in fade it just slows down the FX "for no apparent reason", also some effects can speed up (all PS effects for example, maybe some others as well).
Since fade was the default up to now, it should behave the same as before.
I've taken a look on how to improve performance and visual appeal of blending styles (perhaps a better word would be transitions styles). Here's what to look out for if you'll be doing any experimentation:
effects use SEGCOLOR(x) extensively
effects use SEGPALETTE extensively
effects have no knowledge if they are "old" (previous) or "new" (next) effect
effects have no knowledge if they are in transition or not
effect function always paints entire canvas (isPixelClipped() will return from pixel drawing function prematurely if pixel is clipped, but effect will still draw on entire segment)
color_from_palette() can only distinguish if it is using temporary/transitioning palette for particular pixel if using mapping
transitions do not distinguish if they transition color, palette or effect or any combination of these
If we want to transition each separately, we would need to somehow made:
SEGCOLOR(x) aware for which pixel it is intended for (clipped or non-clipped)
SEGPALETTE switch between "new" palette or "old" palette depending on if pixel (currently drawn) is clipped or not
run effect function twice if we are transitioning from one effect to another (very important for push style transitions) but not otherwise
Current implementation (which always runs effect function twice) deals well with every aspect unless transition style is push and effect is the same. The only downside is loss of performance.
If the effect is the same and more or less static it may still look OK-ish. If it is dynamic it will look awful as it will look as it is being drawn twice.
@DedeHaiunified-blend branch in my fork has effect transition styles (AKA blending styles but I will use transition style from now on) reworked and to me they seem much improved. I removed double call to effect function if transition style is FADE and the effect itself does not change but for other conditions two calls to effect functions are still there.
FPS is also improved. ESP8266 is able to run at 50 FPS when transition occurs on a 16x16 matrix.
Activity
DedeHai commentedon Jan 31, 2025
I want to add the "blending" on brightness change to the list. I only tested that on 2D so far and it makes 2D setups unusable with anything other than "fade". I dont think anyone wants to go to base color every time the brightness changes.
edit:
it is the same in 1D. to reproduce: choose any effect other than solid, set to swipe right for example, change brightness.
DedeHai commentedon Feb 9, 2025
I did some investigation on the "FPS limit not respected" issue. Printing out time intervals between service() shows it is correct. however, there seems something odd about transitions, FPS do drop a lot even if it is not an FX transition, for example I set the transition time to 5s, ran three "soap" FX in overlay (to stress the MCU more) and compared 0.15 to 0.16:
in 0.15 there is barely any change in FPS, in 0.16 it drops significantly. I can confirm this is happening only since the "blending styles" were merged.
@softhack007 do you know what is going on here? may this be related to your update to FPS limit/timing handling? Unfortunately the commits are all over so I was not able to pin it to any commit.
edit:
during my testing, commenting this line made the FPS drop go away (and also breaks transitions, so just as a hint): https://github.com/Aircoookie/WLED/blob/4d53e0adde054519e84b5bc1b637452980ff9975/wled00/FX_fcn.cpp#L1531
blazoncek commentedon Feb 9, 2025
What if you move min() out of function call?
DedeHai commentedon Feb 10, 2025
The issue is actually not the frame delay, that stays constant and correct.
what may be at play is how old/new FX is treated during non-FX transitions. So far I was not able to decipher what exactly is going on but FPS drop suggests that effects are executed twice now where as in the old code it was not.
blazoncek commentedon Feb 10, 2025
That is correct and expected if you want to transition from one effect to another. Unfortunately if effect does not change it is still run twice as color/palette change may need rewriting LED data.
DedeHai commentedon Feb 10, 2025
can it be skipped in fade mode?
The double-execution of course makes sense in other transition styles but in fade it just slows down the FX "for no apparent reason", also some effects can speed up (all PS effects for example, maybe some others as well).
Since fade was the default up to now, it should behave the same as before.
blazoncek commentedon Feb 10, 2025
Not with current implementation. It would require additional checking.
blazoncek commentedon Feb 10, 2025
FYI if you did not notice in previous versions, there was an abrupt change of effect at some point of transition.
blazoncek commentedon Feb 16, 2025
I've taken a look on how to improve performance and visual appeal of blending styles (perhaps a better word would be transitions styles). Here's what to look out for if you'll be doing any experimentation:
SEGCOLOR(x)extensivelySEGPALETTEextensivelyisPixelClipped()will return from pixel drawing function prematurely if pixel is clipped, but effect will still draw on entire segment)color_from_palette()can only distinguish if it is using temporary/transitioning palette for particular pixel if using mappingIf we want to transition each separately, we would need to somehow made:
SEGCOLOR(x)aware for which pixel it is intended for (clipped or non-clipped)SEGPALETTEswitch between "new" palette or "old" palette depending on if pixel (currently drawn) is clipped or notCurrent implementation (which always runs effect function twice) deals well with every aspect unless transition style is push and effect is the same. The only downside is loss of performance.
If the effect is the same and more or less static it may still look OK-ish. If it is dynamic it will look awful as it will look as it is being drawn twice.
blazoncek commentedon Mar 3, 2025
@DedeHai
unified-blendbranch in my fork has effect transition styles (AKA blending styles but I will use transition style from now on) reworked and to me they seem much improved. I removed double call to effect function if transition style is FADE and the effect itself does not change but for other conditions two calls to effect functions are still there.FPS is also improved. ESP8266 is able to run at 50 FPS when transition occurs on a 16x16 matrix.
DedeHai commentedon Mar 4, 2025
I will check it out hopefully later this week.