I have been trying improve the performance of my game on iphone. Most of the cases, I do my all texture loading just before rendering the current frame. That makes big jerk in the frame rate. Anybody tried loading texture in secondary thread or something like that?
views:
93answers:
2
A:
Is there any specific reason why you load youre textures before every frame and not once for the whole scene?
caahab
2010-06-15 05:30:27
I does not mean to say that before every frame. Instead demand loading; If the required texture for rendering is not loaded than I will load it.
shakthi
2010-06-15 06:51:26
Ahh, okay. So you can already check which textures you need to load. Depending on your scene you might do some predictions aboute what get renderd the next frame(s) and load that before in parallel.Depending on your load strategy you can load the textures into system memory before and fetch them to opengl if necessary.
caahab
2010-06-15 07:07:51
A:
My experience is that you need to load all textures before you kick off the game. The iPhone is a single cpu device so loading the textures in a separate thread will not help much.
Jens Utbult
2010-06-15 07:25:08
Hi, Have you tried EAGLSharegroup (See the thread that I mentioned)? I shall give a try.
shakthi
2010-06-15 14:35:18
To be honest I don't think you will have any luck loading textures while the game is running. There is simply not enough resources left and running texture loading in a separate thread will not change that fact. You most likely have to load all textures before you start the game.We do use threads and EAGLSharegroupb though in our game but it's only to not block the user interface while loading textures before the game starts.
Jens Utbult
2010-06-16 10:13:12