You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depsgraph is being waited for before rendering starts.
Computers have two separate devices: CPU and GPU that could run simultaneously, but UPBGE apparently doesn't take advantage of this. I read through the KX_Scene.cpp file to confirm my fears. And as I far as I understand the depsgraph is being waited for before calling the rendering. Which is a problem.
I have a game scene where depsgraph is taking between 10 to 20 ms to run. Which could result in a descent FPS on its own. But rendering also takes addition 10 to 20 ms. In which case, with a computer that is capable of giving me about 60 fps I get only 25 to 30.
I did everything I could to optimize the scene. To use as little depsgraph updates as possible. But I have been met with a wall, crossing which makes the game unplayable. It is either I get 25 FPS ( or lower ) or I should not have any objects in the scene at all.
Other people were met with similar issues online. Like in these posts:
Move Depsgraph to separate thread so it would calculate in the same time as rendering.
Obviously the main issue with that is that render has to have the updated scene to render it. But having a delay of one or two frames will not be a significant problem, if instead we double the overall FPS of the game. Basically we can let the renderer render the latest available frame, while the depsgraph will update for the next frame. If both depsgraph and render each take 15 ms to finish, we will still need only 15 ms. Not 30 ms as in the current configuration.
At the very least this could be introduced as an option, so people with heavy scenes like mine could sacrifice some accuracy for performance.
The text was updated successfully, but these errors were encountered:
Problem
Depsgraph is being waited for before rendering starts.
Computers have two separate devices: CPU and GPU that could run simultaneously, but UPBGE apparently doesn't take advantage of this. I read through the KX_Scene.cpp file to confirm my fears. And as I far as I understand the depsgraph is being waited for before calling the rendering. Which is a problem.
I have a game scene where depsgraph is taking between 10 to 20 ms to run. Which could result in a descent FPS on its own. But rendering also takes addition 10 to 20 ms. In which case, with a computer that is capable of giving me about 60 fps I get only 25 to 30.
I did everything I could to optimize the scene. To use as little depsgraph updates as possible. But I have been met with a wall, crossing which makes the game unplayable. It is either I get 25 FPS ( or lower ) or I should not have any objects in the scene at all.
Other people were met with similar issues online. Like in these posts:
https://blenderartists.org/t/depsgraph-what-exactly-is-it-upbge-0-3/1396267
https://blenderartists.org/t/how-to-optimize-for-the-depsgraph-or-disable-it-in-upbge-0-3/1397793
Solution
Move Depsgraph to separate thread so it would calculate in the same time as rendering.
Obviously the main issue with that is that render has to have the updated scene to render it. But having a delay of one or two frames will not be a significant problem, if instead we double the overall FPS of the game. Basically we can let the renderer render the latest available frame, while the depsgraph will update for the next frame. If both depsgraph and render each take 15 ms to finish, we will still need only 15 ms. Not 30 ms as in the current configuration.
At the very least this could be introduced as an option, so people with heavy scenes like mine could sacrifice some accuracy for performance.
The text was updated successfully, but these errors were encountered: