GLSurfaceView slows for a moment

Started by ramzes0071, January 19, 2014, 12:25:56 PM

Previous topic - Next topic

ramzes0071

Hi,

I need some help. I have my game renderer and it works ok, but at some point of time I add another Object3D (it is added to world from the beginning but is invisible, so I change only its visibility) and when it appear, for a moment my game slow down, fps too. This action occurs only when I first time do this manipulation. When I repeat it again everything looks ok. My Object3D is't complex.

I don't know what is going on. Do you have  any solutions for this problem?

EgonOlsen

That's because objects need some processing before they can be displayed. By default, this happens at runtime when the object will be rendered for the first time. You can use World.compileAllObjects() to shift a huge part of that workload to the setup phase.

EgonOlsen

Texture uploads can be another issue. You can use TextureManager.preWarm(...) to pre-upload textures.

ramzes0071

I have World.compileAllObjects(), and now I added TextureManager.preWarm(...) .
Looks fine  :)
thx

Irony

As this seems to be a relatively common issue, and it's pretty hard to figure out for a beginner, I have added a page to the Wiki under "Advanced topics" (did not want to add it to performance tips as those all seem to be for Android in general, not JPCTAE specific)
Hope that's ok!