mpstark / DynamicCam

A more dynamic camera for World of Warcraft.
MIT License
23 stars 11 forks source link

Major FPS drop and Heavy CPU strain when Dynamic Cam is enabled under CPU Bottleneck #90

Closed V1rtuou5 closed 9 months ago

V1rtuou5 commented 11 months ago

Dynamic Cam is causing Massive FPS reduction when under a CPU bottleneck in comparison to typical addon performance hit. Under my careful observation, DC causes an insane 21% FPS hit when the CPU is limiting the FPS, a 37 FPS drop in my case!

I'm linking screenshots showing that ONLY DC is enabled during testing and that GPU usage % is under the 90% threshold therefore proving it's a CPU bottleneck.

Such a wonderful addon that I can't play without, but sadly needs drastic performance optimization, I believe in you!

"Disabled" Dynamic Cam disabled

"Enabled"

Dynamic Cam enabled
LudiusMaximus commented 11 months ago

Wow, this is fascinating. It is true that DynamicCam does some calculations on every frame update. E.g. making adjustments to other variables according to the current camera zoom level. I can have a look at the respective functions and see if I can cut some corners. But I am not sure how to even test it. My monitor can "only" display 144 FPS. So how can I even reach the state where the CPU becomes the bottle neck... (?)

LudiusMaximus commented 11 months ago

So, I discovered the "overclock" mode of my screen, which allowed me to go up to 160 FPS. However, I can achieve this FPS regardless of whether DynamicCam is enabled or not. Maybe my CPU is too powerfull to become the bottle-neck at 160 FPS? I have an "Intel(R) Xeon(R) W-11855M CPU @ 3.20GHz". Or it has to do with your specific DynamicCam settings. How many DynamicCam situations do you have enabled? Could you try what happens if you disable these?

V1rtuou5 commented 11 months ago

I made sure to set everything to default and the performance drop is still there. To see how much the addon limits the cpu you'll want to disable anything that caps FPS such as Vsync, MSI Afterburner / Rivatuner FPS cap etc.

Make sure your GPU usage % isn't around 90% or higher. If you're FPS is not limited by CPU then turn up View distance, environment distance and shadows since these hit CPU hard.

You will also need a software to closely monitor FPS, GPU usage, and frametimes while in-game. The gold standard is MSI Afterburner https://www.msi.com/Landing/afterburner/graphics-cards

If you want I can assist setting it up properly for you over a Discord call to make sure testing parameters are proper. Discord is V1rtuou5#2213

LudiusMaximus commented 11 months ago

Thanks for your tipps! With vsync disabled, I managed to get max FPS regardless of my monitor's refresh rate. I found some graphics settings that gave me ~90% GPU usage. And in fact I can now see a difference between DC enabled (~130 FPS) and DC disabled (~140 FPS).

I had an initial look at what was my first suspect. Maybe you can do the same in your setup and tell me your findings: In the DC code, look into the files

MouseZoom.lua UiHideModule.lua Core.lua

There you will find several lines which include the string ':SetScript("OnUpdate",' Comment these lines (preceede with --) and /reload the WoW UI.

Do you see a difference?

V1rtuou5 commented 11 months ago

Could you add me on Discord V1rtuou5 and we can go over the code and test together? I'm not a programmer and I'm not sure exactly by what you mean by " Comment these lines (preceede with --)"

On Fri, Dec 29, 2023 at 7:42 AM LudiusMaximus @.***> wrote:

Thanks for your tipps! With vsync disabled, I managed to get max FPS regardless of my monitor's refresh rate. I found some graphics settings that gave me ~90% GPU usage. And in fact I can now see a difference between DC enabled (~130 FPS) and DC disabled (~140 FPS).

I had an initial look at what was my first suspect. Maybe you can do the same in your setup and tell me your findings: In the DC code, look into the files

MouseZoom.lua UiHideModule.lua Core.lua

There you will find several lines which include the string ':SetScript("OnUpdate",' Comment these lines (preceede with --) and /reload the WoW UI.

Do you see a difference?

— Reply to this email directly, view it on GitHub https://github.com/mpstark/DynamicCam/issues/90#issuecomment-1872098512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM45XGNYGENOYYLOZZQFFUTYL3CCVAVCNFSM6AAAAABBFKBK32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGA4TQNJRGI . You are receiving this because you authored the thread.Message ID: @.***>

LudiusMaximus commented 9 months ago

We identified the issue being caused by using CreateFrame("PlayerModel"): https://www.wowinterface.com/forums/showthread.php?t=59749

This was only needed for advanced zooming. It was made optional since version 2.6.0.