Hey all, is there a possibility that the Linux Player is locked at 60 regardless?
Reason I’m asking; I have a special use-case for rendering faster than the screen; I’m attempting motion blur by rendering “subframes” between each displayed frame.
To do so, I have the following setup:
Physics at 30fps
Actual target framerate set to 120Hz of which is quadruple the desired framerate (30fps)
The effect itself counts the frames, and every 4 frames blits a motion-blurred one to the screen.
Now, as expected, this works on Windows and the Linux Editor HOWEVER: It isn’t working inside a Linux build; no matter what I do, it likes to cap itself at 60fps for seemingly no reason. I’ve already tried turning off all kinds of VSync in Linux itself (some compositors actually force it on for games) and I have it off in the quality settings. Yet on a build, it actually appears to run at 15fps, making it look very jerky, and making it unplayable.
So is this a bug, a feature, or is there a way to render a frame between vblanks? The desired effect is this (Captured during a test run):
No, we don’t force sync to vblank.
As you mentioned, some WMs/compositors/graphics settings can cause this to occur globally.
What version of Unity are you using? Can you send your project (or a subset)?
No VSync on whatsoever, yet here it is. I vaguely remember having similar trouble ages back when working on Android. (different platform, but nonetheless similar problem)
If this is occurring in the built player (i definitely selected the linux player IP) then there’s a bug in unity somewhere…
Please let me know @Tak if you find something similar!
@Tak
New development: it appears Linux Builds made in the Windows Editor don’t exhibit the bug. Only Linux Builds made in the Linux Editor actually do it. Evidence was from a test build I just ran that I compiled on Windows before transferring via SD card to test.
In the meantime, I also found a workaround for getting my effect to work at 60fps instead of 120fps, so if the bug does pop up again, it shouldn’t affect the game performance anymore (or at least it’s “performance” )
One detail I missed; Even though the Gfx.WaitForPresent was there, the game itself had tearing, indicating no VSync
I added a little fps counter locally - it runs 120fps with no (other) modifications here.
I think this indicates that the issue is probably with your environment.
(If the OS/driver is blocking present, this can cause spikes in Gfx.WaitForPresent…)
Being that the issue seemed to vanish last night, I’ll double-check again. Chances are, I did something stupid in my linux environment.
That still doesn’t explain why the editor ran fine though…
EDIT: You can mark this solved, it’s behaving properly now. Not sure why it didn’t before.
In the meantime, I was also able to find another way to smooth out the sampling so it can operate at 60fps, so thank you for your support.