[QUOTE=nimelord;1291477]
My app has unstable time of “frame rendering”:
…
Several frames in a row look normal, but from time to time I have two frames: first expensive and second cheap.
It is ok, or I have to find reason of it?[/QUOTE]
I think you should definitely dig into this and understand what’s going on here.
If these are frame times in milliseconds (ms), it looks somewhat like you’re running with a 70Hz VSync, but every so often one of your frames blows past its 1/70 sec (14.286 ms) frame budget and eats into the next frame. 70Hz is an odd VSync rate (60Hz is more common), but it could be an artifact of how you’re timing. The timing disparity between frames could also be either your app overrunning your frame budget with its internal processing and/or internal GL driver queuing and your workload not pipelining consistently.
First, how are you timing? You should measure the elapsed time between the same point in the frame for frames N and N+1 (e.g. right after SwapBuffers). For timing purposes only, I’d do this (on a desktop GPU): SwapBuffers(); glFinish(); Measure elapsed time since this point in last frame
The glFinish() tends to help prevent internal GL driver queueing (read-ahead) so you can get consistent, meaningful timing statistics for your entire frame.
It’s can also be useful to disable VSync when doing this timing test to see how much actual wall-clock time it actually takes to render your frames, with no idle waiting time.
In case you are using a programming language with built in garbage collection it could also be that you are generating lots of garbage and the spikes are moments when the garbage collector has to stop your application to do its work. Of course, this does not apply if you are using a language with explicit memory management.
This one is disabled. When point lights is off then I have 145 - 170 FPS.
Yes I’m using java.
I thought about garbage collector.
My app call new operator very rare on runtime.
Thus used memory volume increases very slowly.
And GC has no reason perform collecting so often (every several frames, you saw).
May be it some sort of micro collection actions?
Try to find out of it.
It does not have to be your code that generates the garbage. If you are using some kind of library, framework or binding that maybe that is generating garbage too (although a good one shouldnt). Use a profiler if you want to be sure about it.
No, sorry.
I have no enough time to play with OpenGL.
But I have one thought. It may be related with management process of basic thread of application by OS.
You can try run your engine in separate thread and see result.