H1emu / h1emu-launcher

A launcher application used to download, patch and launch Just Survive as well as download and install H1Emu server files.
https://h1emu.com/
GNU General Public License v3.0
24 stars 11 forks source link

Use too much GPU #30

Closed QuentinGruber closed 1 year ago

QuentinGruber commented 1 year ago

@Eavilaswayce it's the carrousel who use a decent amount of the gpu like literraly the red loading bar

Eavilaswayce commented 1 year ago

How do you know this? The red loading bar is just a DoubleAnimation which there are like 100 of in the launcher so I don't see why this one would be any different :/

I did, however, read somewhere that the use of DropShadow effects in WPF increases GPU usage a lot for some reason, this could be it possibly.

QuentinGruber commented 1 year ago

How do you know this? The red loading bar is just a DoubleAnimation which there are like 100 of in the launcher so I don't see why this one would be any different :/

I did, however, read somewhere that the use of DropShadow effects in WPF increases GPU usage a lot for some reason, this could be it possibly.

Well open your task manager and look how much gpu is used, 30+% when the carrousel is running and 0 when i put the mouse on it ( so it stop ).

Eavilaswayce commented 1 year ago

Damn you're right, for me it uses ~18% GPU and then when the carousel stops it's 0%. Wonder if it's possible to limit GPU usage on a WPF app?

QuentinGruber commented 1 year ago

Damn you're right, for me it uses ~18% GPU and then when the carousel stops it's 0%. Wonder if it's possible to limit GPU usage on a WPF app?

No idea but for real the refresh rate of your animation is probably too fast even to see

QuentinGruber commented 1 year ago

Maybe we could just remove that animation ? @Eavilaswayce Yeah it looks cool but for what it cost :sweat_smile:

QuentinGruber commented 1 year ago

I just took a look @Eavilaswayce. The problem is that the animation is rendered for every px between 0 and the width of the rectangle. If there was a way to make the animation render only every 5 pixels, it would improve performance and no one would notice a difference.

QuentinGruber commented 1 year ago

I just took a look @Eavilaswayce. The problem is that the animation is rendered for every px between 0 and the width of the rectangle. If there was a way to make the animation render only every 5 pixels, it would improve performance and no one would notice a difference.

you can test it by changing the time the animation take with more time the animation have less px to travel per sec and so consume less gpu