SuperTuxKart on Pandora 1Ghz


Other possibilities would include optimising irrlicht itself.
You might want to talk to Cloudef about that.
 
Recompiled the Bullet physics library with "-Ofast" and I have better performances. Without music, and with 3 A.I., I have more than 15fps, and 20fps often, if the "Oliver Math track". I still have a corruption of texture happening, probably with the map (lower left side), that still doesn't really show up. I have to understand where this minimap is calculated and drawn in the source code. I would like to fix that before doing a first release.

A few fresh screenshots (also, note that I have a Rebirth edition, O/C to 1GHz, not GHz Pandora with the faster GPU).

130227-214520.png130227-214542.png130227-214604.png130227-214647.png

*EDIT*: Found how minimap is drawn. Main work is in "tracks/quad_graph.cpp" (init of the the minimap texture -that is POT compatible- is inside track.cpp, and drawing on screen inside race_gui.cpp). It use RenderToTexure. So now, I have to check Irrlicht and the RTTProvider... I think it (the RTTProvider in my version of GLES/Irrlicht) doesn't work properly.
 
Last edited by a moderator:
Maybe physics code is using floats a lot, make sure you enable VFP instruction support with "-mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp". It's not enabled by just -O3 -Ofast or whatever.
 
Last edited by a moderator:
How well is this likely to run at 800Mhz after optimisations?

Is it possible to tell?

Great work anyway, I'm looking forward to this one :)
 
How well is this likely to run at 800Mhz after optimisations?

Is it possible to tell?

Great work anyway, I'm looking forward to this one :)
Without music, it should work ok. Time will tell  ^_^

Maybe physics code is using floats a lot, make sure you enable VFP instruction support with "-mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp". It's not enabled by just -O3 -Ofast or whatever.
Yes, I have enable neon support. It is float intensive, and the -ffast-math seems usefull (I didn't notice any bad side effect). I may have to look to see if they just use float or double, I think it's float, but have to look deeper.
 
  • Like
Reactions: abc
I wish I knew more about programming and compiling. I'd love to test any PNDs any of you guys might want tested.
 
I pointed the STK dev team to this forum:

http://forum.freegamedev.net/viewtopic.php?f=17&t=4249

Feel free to ask about further improvements ;)

BTW Thanks for giving it a try :)
Ok, thanks. I'll try to play with the "animation"... For the info, I am using the ogl-es branch (slighlty modified), and I confirm gles2 doesn't work. I'm trying to get RTT to work. Than, I have a few texture left to resize, take care of the "files that need to be written" and make a PND.

I wish I knew more about programming and compiling. I'd love to test any PNDs any of you guys might want tested.
I don't have a PND yet, and it will be too big to be put here anyway (10Mo limit of size inside the Forum). So it will go directly to the repo (tagged as beta maybe).
 
Ok, previous test was running with level detail of "3". I have reduced the level to "1" (no more animation), and I have better framerate. Betwen 20 and 30 fps on the same track !

*EDIT*, I was playing at "4", and now I tried "2". "1" is with non-animated background object (didn't tried yet)
 
Last edited by a moderator:
I'm kind of stuck on Render To Texture now (it's used on minimap and kart selection at least).

The Irrlicht render to texture code looks fine for me.

Basicaly, the code is that:

First init a FBO object (I let the Irrlicht code as is, but yes, Driver->extGlGenFramebuffers is a wrapper that call the glGenFramebuffers point function correctly initialised)


Driver->extGlGenFramebuffers(1, &ColorFrameBuffer);
Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_OES, ColorFrameBuffer);

// generate color texture
glGenTextures(1, &TextureName);
glBindTexture(GL_TEXTURE_2D, TextureName);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width,
ImageSize.Height, 0, PixelFormat, PixelType, 0);

// attach color texture to frame buffer
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, TextureName, 0);
Here, PixelType= GL_UNSIGNED_BYTE, PixelFormat=GL_RGBA and InternalFormat=GL_RGBA (initialy, it was GL_RGBA8_OES, but result is the same).

Then it create a Depth Render buffer

Code:
Driver->extGlGenRenderbuffers(1, &DepthRenderBuffer);
Driver->extGlBindRenderbuffer(GL_RENDERBUFFER_OES, DepthRenderBuffer);
Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_OES, InternalFormat, ImageSize.Width, ImageSize.Height);

here InternalFormat=GL_DEPTH_COMPONENT16_OES

 

Then it bind the render buffer to framebuffer


Code:
Driver->extGlFramebufferRenderbuffer(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, DepthRenderBuffer);

 

 

After that init phase, rendering to the texture is done by calling


Code:
Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_OES, ColorFrameBuffer);

 

 

But nothing render (the texture stay empty)... As an experiment, if I change the InternalFormat (and PixelFormat) to GL_RGB, it render (but without alpha, so it's not usefull for STK).

 

Anyone has got an idea ???
 
Last edited by a moderator:
Ok, previous test was running with level detail of "3". I have reduced the level to "1" (no more animation), and I have better framerate. Betwen 20 and 30 fps on the same track !

*EDIT*, I was playing at "4", and now I tried "2". "1" is with non-animated background object (didn't tried yet)
Note that you can select the grpahics level in more detail - either in the GUI, or look at the config.xml file.

Animated background objects shouldn't have much (if any) impact - the FP operations on CPU are minimal, and the object is drawn somewhere anywhere, so no change on GPU. Skeleton animations are more of a problem though.

Cheers,

     Joerg (aka hiker, STK admin)

Anyone has got an idea ???
Have you tried disabling FBO? It is usually a driver issue, but we have been able in the past to fix some texture issues for some people by disabling FBOs.
 
I don't know how relieble the ingame fps counter is, but I haven't found a direct link between triangle count (that go from 7K to 30K sometimes) and framerates. There are some "low poly" models also, for somes objects (bananas, gift, I don't remeber). Haven't see if there are automaticaly used or not. Another thing to check (and se the effect of that).
The low-poly objects are used for LOD (level of details) - depending on distance an appropriately low-level (even empty iirc) version is shown.

So you could try modifying the distance (if LOD is specified in the track.xml file (search for lod_distance) FYI math class does not use this). For items the models are specified in data/items.xml, but the distances to use is hardcoded in items/item.cpp, e.g.:


lodnode->add(35, meshnode, true);
scene::IMeshSceneNode* meshnode = irr_driver->addMesh(lowres_mesh);
lodnode->add(100, meshnode, true);





Ok, thanks. I'll try to play with the "animation"... For the info, I am using the ogl-es branch (slighlty modified), and I confirm gles2 doesn't work. I'm trying to get RTT to work. Than, I have a few texture left to resize, take care of the "files that need to be written" and make a PND.
If you have fixed any bugs or other improvements I would be interested in the patch, as would be the irrlicht team I am sure.

Cheers,

   Joerg
 
Wahoo ! Thanks for all those tips. I will look at the LOD for object to reduce polycount.

About disabling FBO, not sure the current ogl-es branch has a fall back method for RTT :(
 
Ok, I have put an early beta to the repo. I have tested it on a Rebirth (O/C at 1GHz) and a CC (O/C at 800 MHz), and both are working fine, once you lower detail to "2". I still don't have any RTT working. I deactivated FBO inside Irrlicht, but no better result. The only way to have some kind of RTT is using GL_RGB, but without Alhpa channel, it's useless.

I open a thread in "Software news" : http://boards.openpandora.org/index.php/topic/12213-supertuxkart-for-pandora/
 
Last edited by a moderator:
Ok, I have put an early beta to the repo. I have tested it on a Rebirth (O/C at 1GHz) and a CC (O/C at 800 MHz), and both are working fine, once you lower detail to "2". I still don't have any RTT working. I deactivated FBO inside Irrlicht, but no better result. The only way to have some kind of RTT is using GL_RGB, but without Alhpa channel, it's useless.

I open a thread in "Software news" : http://boards.openpandora.org/index.php/topic/12213-supertuxkart-for-pandora/
Do you have any idea which graphical details caused the most overhead (or the other way round: disabling which feature gave you the most benefit)? Likely kart animations was the main contributor, but it would be good to know what else has a significant impact on slower systems.

If you have a patch that uses a #define to disable minimap, I am happy to add this to our sources.

Cheers,

   Joerg
 
Last edited by a moderator:
(very minor 'feature')

As it is, the minimap and kart preview display what look like random textures discarded from other parts of the game.

If making them work properly is a long term goal, could they just be disabled entirely in the meantime?
 
Well it works great for me! Except the problem with the minimap and such. But it's still super fun!
 
Last edited by a moderator:
As it is, the minimap and kart preview display what look like random textures discarded from other parts of the game.

If making them work properly is a long term goal, could they just be disabled entirely in the meantime?
The core STK team just doesn't have enough developers to support all ports, that's why we restrict the list of officially supported platforms. Plus none of us has an openpandora, so we couldn't even test.

But if someone here creates a patch and send it to us (using #ifdef to have a compile option to disable rtt), we would certainly add this to our trunk.

Cheers,

    Joerg
 
I'll try to make something. 

For now, I have recompiled bullet with NEON optims (it wasn't activated in Bullet in Build 01 & 02), and I have better speed !

About kart selection and minimap, I can try to disable them, but I'll first try to swith from FBO to pbuffer in Irrlicht (unless new beta SGX driver just work).

I also found that on the "farm" track, the truck marks uses some bumpmappig, and it is quite taxing for our little SGX. But the main graphical bottleneck is mainly siwe of texture (I downloaded and old track, with small texture and easy triangle workload, and it was very fast, 40fps with Build 02) 

Anyway STK is a great game ! Congrats to the whole team !!!
 
Back
Top