juzzlin / DustRacing2D

Dust Racing 2D is a traditional top-down car racing game including a level editor.
http://juzzlin.github.io/DustRacing2D/index.html
GNU General Public License v3.0
301 stars 67 forks source link

very slow on raspberry pi 4 (64 bit) #130

Open kiai72 opened 1 year ago

kiai72 commented 1 year ago

Hello on Raspberry Pi OS (64 bit) (2.1.1. from the official repository) it's unplayable slow.

why ? other games like supertuxkart work fine.

juzzlin commented 1 year ago

My guess is that there might be no HW acceleration on Raspberry Pi for framebuffer blitting that is being used in renderer.cpp:

QOpenGLFramebufferObject::blitFramebuffer(m_shadowFbo.get(), m_fbo.get(), GL_DEPTH_BUFFER_BIT);

kiai72 commented 1 year ago

But why only with this game. Supertuxkart for example works fast.

juzzlin commented 1 year ago

But why only with this game. Supertuxkart for example works fast.

That's because SuperTuxCart and other games very likely don't use framebuffer blitting at all. In Dust Racing 2D it's being used to create those fake 3D shadows. I'm only guessing that it could be the reason.

kiai72 commented 1 year ago

ok, is there a flag to turn this feature off ?

juzzlin commented 1 year ago

Try this out: 596a0f1fe1885e7b5890b949b913adf3b63d2f8c

juzzlin commented 1 year ago

Build with -DDisableFramebufferBlits=ON and it will render the shadows directly to the target framebuffer. The only downside is that they will be pretty bad. However, if this fixes the performance issue on Raspberry Pi I could try to improve that method.

kiai72 commented 1 year ago

i build with cmake ../.. -DDisableFramebufferBlits=OFF make

but it does not change anything. still unplayable slow. Or do i have to set a flag in .conf as well ?

juzzlin commented 1 year ago

i build with cmake ../.. -DDisableFramebufferBlits=OFF make

but it does not change anything. still unplayable slow. Or do i have to set a flag in .conf as well ?

Should be -DDisableFramebufferBlits=ON. I made a typo in my earlier comment, but immediately fixed it :)

kiai72 commented 1 year ago

i tried with -DDisableFramebufferBlits=ON as well (+ another make) -> no change!

not only the game is slow - even the menu is very slow.

juzzlin commented 1 year ago

Stupid question, but did you update the source code from master branch so that it actually included my framebuffer hack in commit 596a0f1fe1885e7b5890b949b913adf3b63d2f8c ?

If yes, then the root cause for the slowness must be something else and needs more investigation.

kiai72 commented 1 year ago

after you wrote about this new feature i downloaded the master as zip ...

kiai72 commented 9 months ago

so can we please add more switches that simplify the graphics - to make it run on rpi4 ?