views:

93

answers:

2

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?

A: 

Is there any specific reason why you load youre textures before every frame and not once for the whole scene?

caahab
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
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
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
Hi, Have you tried EAGLSharegroup (See the thread that I mentioned)? I shall give a try.
shakthi
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