renderOneFrame() time oscillation

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Posts: 14
Joined: Tue Oct 23, 2018 1:32 pm
x 1

renderOneFrame() time oscillation

Post by overtired »

Hello, everyone!
I am trying to make an android app with ogre. I would prefer to use ogre with java binding, but it is not problem to recompile the shared library with some changes.

I create a scene (light source, camera, viewport, texture on background, nothing else) and begin calling renderOneFrame() on each frame from java side (using android handler). I would like to have stable 60 fps, but renderOneFrame() takes different time from ~5ms to ~45ms, commonly about 15-18ms which leads to notable lags.

Does anybody know why is it going on and what depends on?
All I need from the ogre engine for now is to place some models and play animations. Maybe I can remove some unnecessary for me code from renderOneFrame()?

OGRE Team Member
OGRE Team Member
Posts: 1164
Joined: Sun Mar 30, 2014 2:51 pm
x 438

Re: renderOneFrame() time oscillation

Post by paroj »

Without having much experience with this, I would guess the way we call renderOneFrame in the JNI Sample is not very clever.

A quick googling on the topic revealed this
- ... lgl-es-2-0
- ... -gameloops

renderOneFrame() automatically calls eglSwapBuffers when it is done. You may want to experiment with doing it manually by using external GL control. ... 2f6e6c847e

In case this property is not fully implemented on Android, you can comment out eglSwapBuffers here: ... w.cpp#L145

Post Reply