New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P3D strange framerate behavior #4846

Closed
aarondbaron opened this Issue Jan 22, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@aarondbaron

aarondbaron commented Jan 22, 2017

When I have a simple sketch that uses P3D, many times the framerate seems to hover around 30fps, even if the framerate function framerate(60) is called. However, the framerate moves back up to 60fps under certain conditions. I noticed that the framerate would go back up to 60fps if i had youtube open in some browser, and the browser was open. If youtube wasnt open it would go back down.

I don't understand why this is happening. Since it seemed to get better when a youtube front page tab was open, i assumed there is either something on the site itself that is 'activating' my hardware.

To investigate further, I used the processing video library and tried to run the video example called loop. The idea would be that perhaps the hardware would 'activate' if i forced processing to run a video. After changing the size function to have it be p3D, and then printing the framerate to the screen text("fr: " + frameRate, width/2, 10 ); the same behavior is noted. where the video runs at only round 30fps. (By contrast, the video example would run at 60fps using the standard default renderer.) However, when I hovered my mouse over my webbrowser and moved the mouse between tabs, or over hyperlinks, the fraemrate would be bouncing up and down, slowing down to 30 whenever i stopped movnig the mouse, staying up if i opened a youtube tab and had the browser displaying that.

I don't quite understand what is going on, but I have another laptop that has a different graphics card and was getting the same behavior. I would like to use p3d as it is very good at rendering many objects on the screen at once, but it's a bit annoying that i have to have a webpage open to youtube in the background to make it work.

JakubValtar added a commit to JakubValtar/processing that referenced this issue Jan 22, 2017

Keep Windows timer resolution high for OpenGL sketches
Otherwise java.util.Timer used by FPSAnimator uses 10 or 15 ms
resolution, which results in 60 fps sketches running at around 30 fps
and 30 fps sketches running at around 21 fps.

Fixes #4846

@benfry benfry closed this in #4847 Jan 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment