0 votes

I am drawing with the mouse, with an array of points and I draw a line between them. I have the Vsync activated on the graphics card and the fps do not go up to 60. I can force them to go up by activating low processor mode but when I start drawing they go down to 60. By deactivating the vsync on the graphics card they go up to 4000.
What I want is to keep vsync activated on the card and godot ignore it.
I tried several things besides disabling vsync in godot and there is no case, every time I draw they go down to 60.
I always assumed that the cpu and gpu work at different fps independently, is this correct?
In this case the vsync of the gpu limits the fps to 60 when drawing, but the cpu should not go to 144 if for example Engine.target_fps = 144 is used?
The idea is to make an application, not a game. I can disable vsync on the card but if I share the app the experience may vary. Is the vsync option enabled by default on graphics cards?
I hope you can help me understand the godot-gpu-cpu relationship

in Engine by (2,058 points)

1 Answer

0 votes
Best answer

I always assumed that the CPU and pug work at different fps
independently, is this correct?

No. Both are "working" with the same frame rate.

VSync synchronizes the FPS with the refresh rate of the monitor.
Engine.target_fps forces the frame rate to a defined limit.

I can disable vsync on the card but if I share the app the experience may vary.

Your application has not to vary. Therefor we have the delta value in process and _physicsprocess . You can multiply delta with certain actions to make your application "frame rate" independent.

Is the vsync option enabled by default on graphics cards?

Sometimes.
It's not the GPU itself, it's the GPU Driver. People can activate Vsync to force enable it in applications.

Here is an example:
enter image description here

by (394 points)
selected by

Your application has not to vary. Therefor we have the delta value in
process and _physicsprocess . You can multiply delta with certain
actions to make your application "frame rate" independent.

In this case I need the app to run at maximum fps so that the drawing stroke is smooth:
1 - save the most points in an array, these would be the position of the mouse, while applying a linear interpolation between each point.
2- while drawing, call the _draw function to see the trace in real time.
Therefore, it is convenient that the fps are not limited to 60. The number of points saved per unit of time depends on the final fps.

I am also aware that godot is more suitable for games and not for pixel drawing applications. But to clarify a little how godot is related to the graphics card. And now it is clearer, thanks for your response.

Look into using Bresenham's line algorithm to draw lines independently of the FPS.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.