projectcomet64 / metal-orchestrator

Freecam and keyframeable camera for M64MM3.
Mozilla Public License 2.0
4 stars 0 forks source link

Performance improvements to the Timeline #1

Closed GlitchyPSIX closed 1 year ago

GlitchyPSIX commented 2 years ago

Right now the Timeline is a single Bitmap drawn on demand. With very long racks, this can prove to be extremely taxing on the computer and other M64MM addons.

Current ideas to improve performance involve reducing the amount of redraws the Timeline does, and have the trackhead be an object separate from the rack renderer, which would significantly reduce the render time for both.

8192Bit commented 2 years ago

And remember to enable DoubleBuffered for FrmMain. Don't ask why.

GlitchyPSIX commented 2 years ago

And remember to enable DoubleBuffered for FrmMain. Don't ask why.

I'd actually very much like to know why. I think I already double-buffer the Timeline control itself

8192Bit commented 2 years ago

Crazyly, I use WinForm Controls to make a animation, just like some YTPMVs do. and I used some Random classes to make the text shake. However, the program runs ultra-slow and even crashed. But when I magically enabled the doublebuffer option, it worked very well. I think the Timeline Control is also a kind of control so doublebuffer it may accelerate the speed. (I used microsoft grammar checker to correct it)

8192Bit commented 2 years ago

https://github.com/8192Bit/Windows-no-UI-kimoji-yosugidaro here and DO NOT see the code

GlitchyPSIX commented 2 years ago

I already doublebuffer the Timeline UserControl itself to address an issue that it had with flickering.

I think the biggest performance hog for Timeline is how the timeline is rendered manually from zero. (Also WS_EX_COMPOSITED)

But I will try and make the main form DoubleBuffered to see if it makes an impact.

GlitchyPSIX commented 1 year ago

When moving to Keyshift, I have updated the rendering to be delta rendering rather than rendering everything at once at every moment, as well as separating the trackhead parts from the actual racks. This has proven to increase performance by a TON, and I'd say these improvements were covered here.

The Timeline Renderer itself was moved to Keyshift, so I have opened a discussion at GlitchyPSIX/Keyshift#4 to discuss potential more improvement by moving away from GDI+, which is what System.Drawing uses and so do the rest of the Windows Forms controls for even better performance.

Closing this here now.