GLWpfControl icon indicating copy to clipboard operation
GLWpfControl copied to clipboard

Turning off vertical sync doesn't have any effect

Open hanspacket opened this issue 4 years ago • 4 comments

During some prototyping work, I wanted to compare the performance of GLWpfControl with my current approach for rendering OpenGL content in WPF. I would basically like to measure which approach has the biggest performance overhead. My intent is to open a large window, and compare framerates for both approaches. I don't want to add too much actual content so that the performance overhead is more prominent, so I'm painting a fairly lightweight scene using OpenGL.

This means that I end up with high framerates, even for fairly large windows (3840x1080 in my case, I can't seem to go beyond this size). To get proper FPS results, I disabled Vertical Sync in the NVidia control panel. This has the following effect:

  • In the old approach, the framerate is not capped to 60 FPS anymore, and I get framerates of ~250
  • Using GLWpfControl, the framerate remains capped at 60 FPS.

The second point is a bit unexpected for me since I didn't see anything in the GLWpfControl source code that indicates a fixed framerate. I might be wrong though.

Is this a bug ? Is this a normal side-effect of the DirectX-OpenGL interop in GLWpfControl ? Is the framerate capping something I can enable or disable some other way ?

Note that I'm using OpenTK.GLWpfControl version 3.3.0 since I'm using .Net Framework.

hanspacket avatar Jan 18 '22 15:01 hanspacket

It does seem weird that the framerate is limited. This might have something to do with the DX-OpenGL interop, but I'm not sure. I'm not sure when I'll be able to look into this, especially the 3.3.0 version but I'll keep it on my todo.

NogginBops avatar Mar 20 '22 23:03 NogginBops

Hi @NogginBops , did you get anywhere with this? I am experiencing the same issue - 60FPS limited using GLWpfControl 4.1.0

nasser225 avatar Jul 31 '22 06:07 nasser225

I've not gotten to this issue yet. I'm planning a refactor of the DX interop part of this control and while doing that I can look into what the issue is here with vsync

NogginBops avatar Aug 01 '22 07:08 NogginBops