background: fix desktop visualiser lag#1126
background: fix desktop visualiser lag#1126AteebXYZ wants to merge 17 commits intocaelestia-dots:mainfrom
Conversation
Make all bars draw in a single canvas instead of many rectangles
|
Please use a QQuickPaintedItem and QPainter (make a C++ component for it) instead of a canvas. This should help reduce resource usage even more. |
…nding looks weird
|
I switched to a QQuickPainter and it works pretty well so far, all i need to figure out now is how to get the blur to work and to fix the rounded bars aggressively snapping to pixels with no smoothing |
|
okay I fixed the issue with the rounded edges being jagged by switching the render target of QQuickPaintedItem to Image instead of FrameBufferObject, this sacrifices a tiny amount of rendering performance for better anti aliasing. |
|
What's with the spatial smoothing? The cava module already has monstercat smoothing, so we shouldn't need more. Also, it bounces a lot more which is very noisy. |
Did increasing the smoothing values make it feel less jumpy? Also I personally felt that the monstercat smoothing was still too noisy so I added an additional curvature smoothing modifier, but if you want it can be removed. Honestly I don't know how to make the new implementation match the original visualiser since the old implementation lagged so much on my PC. |
|
Does just using the values directly from the cava provider not match the original impl? |
The original impl had Anim with duration small on value change (height of bar), right now im trying to implement that. Setting the cava values directly would be too noisy right? |
|
Hmm, tbh it shouldn't really affect that much. If need be, you can use QPropertyAnimations to achieve the same thing afaik |
Oh i didn't see this when I was implementing the standard Anim curve 😭 |
|
I changed the smoothing function in the cpp to use the cubic bezier curve from the original impl, it should match the original pretty well now. When smoothness is 1 in the config, it should match the old impl smoothness, and if the user wants they can change this value if they dont want their visualiser to be tied to the animation scale set in the config. Also in Visualiser.qml I made it so that it requests bar updates every 16 ms (60fps) so that the animation should remain consistent. |
|
With the spatial smoothing curvature thing, its your call whether it should remain in the visualiser or be removed. |
Changes
Visualiser bars now render in a QQuickPaintedItem, which increases performance drastically
2 new config options under visualiser in shell.json have been added, smoothing (0-1) and curvature (integer), smoothing defines the "slowness" of the bars, a higher value means it will react to audio changes slower and curvature smooths out the bars for less noise making them appear more rounded.