Ventura - UI lag
-
@HISEnberg Are you using blurs? What does Perfetto say when you do a trace?
-
@aaronventure Thanks for the tip. I learned several months ago to avoid using blur in HISE when I can, so no my project doesn't make use of them.
I never did a deep dive into Perfetto before but I am seeing the huge advantages of it now! I am seeing that if I disable the OpenGL flag that the performance is actually improving significantly. Basically I am drawing these FFTs with a path and a timer. I am seeing OpenGL adding some extra overhead on my paint/repaint operations (almost double on average duration).
I wish I had Ventura to test on but I am hopeful this will solve my issues!
-
@HISEnberg Not on Ventura but Sonoma for me, and it's not just the blur, I tried a layer with a desaturate and it was just like a PANIC_MODE=1 flag was activated. Even UI buttons going ON and OFF like crazy once the plugin was loaded in DAW and similar issues in Hise itself... Go figure...
-
@aaronventure Does
dropShadowFromPath
anddropShadow
also have poor performance like blur? -
@orange yes.
DropShadowFromText doesn't because it's based on the Melatonin Blur library.
We're waiting for all the other drop shadow methods and blurs to be ported over to melatonin. It's been... a bit.
-
@aaronventure I was about to use dropShadow on knob’s laf, good to know, thank you
-
@orange said in Ventura - UI lag:
I was about to use dropShadow on knob’s laf, good to know,
I haven't ran into any issues, I think if you're only using a few static shadows there shouldn't be a problem...
-
@orange You can still do it, I use it all the time.
But it's inefficient for what it is - melatonin should be 10-100x performance boost.
If you're making like 150 calls on a panel, it'll visibly eat into the performance. I have this custom keyboard which is shaded and it's a hog.
I also use it for glows on mouse hover/click. In that case I'm adjusting the shadow color with an alpha factor, so when there's no mouse over, there's no glow. But after doing it to the entire interface, it was stupidly slow on something like an M1 Air - the fix was to add an if check to the method call which made sure it was only executing when there's a cursor over it.
So while by itself it's not super expensive, it's very inefficient for what it is and it piles up quickly.
-
@aaronventure said in Ventura - UI lag:
. I have this custom keyboard which is shaded and it's a hog.
Get Christoph to show you how he made the fancy 3D keyboard for the Dorian Marko piano ;)
-
@aaronventure @d-healey Except for mouse over glow, there will be 4 dropShadow s on each knob statically, and there will be 20 knobs in total. So 80 dropShadow will be drawn statically. I think this will consume a lot of CPU.
-
@d-healey That was OpenGL I think, I found his post from the first OpenGL thread.
I spent a few days creating a super cool dynamic background shader and then it just stopped working....
So no thanks, I'll wait for a proper modern, stable, consistent graphics library haha.
-
@orange Well you don't have to guess, you can draw an estimate right now in LAF, call it 4 times (content doesn't matter, only size/area), create 20 knobs in a for loop and open Perfetto (or the new profiler), and you'll get concrete data.
You should probably add a panel beneath it all, with an image or something like that, just in case 20 knobs on an empty background ends up being something where not all of them get redrawn.
This way you force the redraw of the panel, and that might force a redraw of all other knobs, which is a more realistic setup in a complex UI.
Start the trace, and start fiddling with the knobs, then stop the trace and check it out.
-
@aaronventure said in Ventura - UI lag:
That was OpenGL I think
That's only half the story. OpenGL eats CPU too. In the final product it's using images, Christoph had a cool way to generate them.
-
@d-healey Ah, I did work on a UI where the entire thing is pathtraced in blender and each component was exported individually with glows separate, then I wrote a python script to process it all using GIMP (based on metadata) and recombine the glows and shadows into pngs with proper transparency, then put it all together in HISE. Runs great and looks cool, but the memory hit is real (140mb of RAM per instance).
I imagine it's a lot easier for a piano, you basically have up to 18 images per key, or something like that.
-
@aaronventure said in Ventura - UI lag:
140mb of RAM per instance).
The images should be shared across instances
-
@d-healey Ah that's good to know, and makes perfect sense.