martin2250 / OpenCNCPilot

autolevelling gcode-sender for grbl
MIT License
374 stars 113 forks source link

Interface laggy / low fps when zooming in, only on certain hardware #89

Open gamerpaddy opened 5 years ago

gamerpaddy commented 5 years ago

The Interface (viewport) is very laggy when zoomed in. this only seems to happen on my desktop computer (8700k, 32gb ddr4, 980ti win 10 pro) but not on my tablet which i use on my cnc (i5-3320m, intel integrated graphics, 4gb ddr3, win 10 pro)

video: https://streamable.com/khw6i

version: 1.5.4.0

canbaytok commented 5 years ago

I dont see why OCP would be at fault here, since its working fine on your less performant machine, which is why I would suggest that you update your GPU driver or just be a little more radical and reinstall windows completly.

martin2250 commented 5 years ago

This also happens on my machines (both desktop and low-power laptop), but only at much higher zoom levels. At those zoom levels it doesn't affect usability much. I don't know what causes it and there is not much I can do, as the 3D viewport is entirely handled by an external library (HelixToolkit).

You did give me an idea though: I'll try scaling everything up by a factor of 100 or so, maybe this allows zooming in 100x more with the same level of lag. I don't know when I'll get around to it though.

holance commented 5 years ago

If your CPU has integrated graphics card, and the program did not specify to use external graphic card, it may run on the integrated graphics card by default. This may be the root cause of your performance issue. You may want to use following code at program startup or manually run the program using external graphics card.

https://github.com/helix-toolkit/helix-toolkit/blob/develop/Source/HelixToolkit.SharpDX.Shared/Utilities/NVOptimusEnabler.cs

HelixToolkit WPF version is using WPF internal 3D engine for rendering. It does not supports GPU line/point drawing, all lines/points are drawn using CPU. If your scene has many lines/points, it causes performance problem.

I would suggest you to try the SharpDX version and see if performance issue still happens.

Also I saw there are many overlapping WPF controls over the viewport. Try to use BitmapCache on these overlapping controls to improve performance as well.

deHarro commented 5 years ago

Perhaps this info is of some value for the issue...

I run OCP on an i5 without graphics card, the whole rednering is performed on the integrated graphics of the CPU (not that those integrated graphics kernels are bad in any way. In contrary, I'm very pleased of the overall performance, but I'm no gamer). I have no performance issues with OPC at all, even when zooming in to a single via fullscreen.

Harald

holance commented 5 years ago

It depends on the resolution of your monitor as well. If your monitor has HD resolution or connects with multiple monitors, integrated graphics card will not perform well.

deHarro commented 5 years ago

Ok, I can follow :) The monitor has only 1280 x 1024 pixels and it's a single monitor installation (at the CNC machine).

On my office machine I use the integrated graphics, too. Here I have two monitors, 2556 x 1440 and 1920 x 1200, respectively. No performance issues with OCP. Ok, this machine has an i7@4GHz.

But obviously others have issues with the performance, and trying to improve OCP by changing the graphics subsystem is not so bad, I'm with you. Harald

gamerpaddy commented 5 years ago

you guys are mixing this up

-it runs better on integrated graphics on a slow pc -it runs worse on the one with a dedicated gpu thats overall very fast.

loading in a gcode file that draws a bunch of lines makes the program unuseable on problematic computer this is all about.

deHarro commented 5 years ago

I think I should delete my comments above, they seem to add only traffic and lead the discussion into a wrong direction. Sorry. Please ignore my comments! Harald

holance commented 5 years ago

Since Helixtoolkit wpf is using wpf internal 3d engine, you may want to check if you have driver issue.