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?
Asked
Active
Viewed 690 times
3
-
It seems to my question is a duplicate of http://stackoverflow.com/questions/1253145/how-to-use-opengl-es-on-a-separate-thread-on-iphone – shakthi Jun 15 '10 at 13:36
2 Answers
0
Is there any specific reason why you load youre textures before every frame and not once for the whole scene?

caahab
- 151
- 1
- 7
-
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 Jun 15 '10 at 06:51
-
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 Jun 15 '10 at 07:07
0
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
- 923
- 1
- 7
- 16
-
Hi, Have you tried EAGLSharegroup (See the thread that I mentioned)? I shall give a try. – shakthi Jun 15 '10 at 14:35
-
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 Jun 16 '10 at 10:13