Log in or register to post comments

Frame Rate of my application

August 22, 2012 - 4:37am #1

Hi everybody,

Does anybody there know how to get the frame rate (fps) of you Vuforia Applications? I'm using ImageTargets as code base, and would like to know how this value change when I chage the object (number of poligons, number of objects...). Any idea of how to know it? I would like to have the value and print it in the LogCat. 

Thanks!

 

Frame Rate of my application

August 27, 2012 - 11:41am #9

You should be seeing around 30fps so I think your new way of calculating fps is more acurate. 30fps will look like smooth video. at 15fps the video is very choppy.

Thank you,

-Peter

Frame Rate of my application

August 25, 2012 - 4:06am #8

Ouch, that's tirght

I thought it was normal since is the same frame rate I obtain with another library, Nyartoolkit. Maybe it's the way I calculated, cause my video doesn't look choppy. Anyway, revising my log, I realised the real value was about 30 (not in Nyartoolkit but Vuforia) . Is that normal? or still low? I'm using Image Targets sample. The only thing I changed was the objet to draw, 2 cubes in spite of the teapot (I think it may be even easier than the teapot, with much less vertives and polygons) I'll explain you how I did:

My OndrawFrame of ImageTargetsRenderer.java woul be like that:

  public void onDrawFrame(GL10 gl)

    {

        if (!mIsActive)

            return;

//Code to calculate fps

       _frameCount++;

       long now = System.currentTimeMillis();

      long delta = now - _timeLastSample;

       if (delta >= FRAMERATE_SAMPLEINTERVAL_MS) //FRAMERATE_SAMPLEINTERVAL_MS=1000;

      {

     _fps = _frameCount / (delta/1000f);

      DebugLog.LOGD("FPS: " + Math.round(_fps));

      _timeLastSample = now;

      _frameCount = 0;

      }

        // Call our native function to render content

        renderFrame();

    }

 

Frame Rate of my application

August 24, 2012 - 4:06pm #7

Hello,

That is very low and not normal. 15fps looks very choppy on screen. Does your background video look choppy? If not there may be an issue with how the fps is calculated. If it is choppy then we should investigate what is going on. What device are you using? Do you see the same choppy video in the ImageTargets sample application on your device?

Thank you,

-Peter

Frame Rate of my application

August 24, 2012 - 11:29am #6

It's me again. Another question, just in case. It's 15, 16 fps a normal value for the Vuforia frame rate?

Thanks again

Frame Rate of my application

August 24, 2012 - 11:28am #5

Hi again,

Finally I calculate it from the "onDrawFrame" in ImageTargetsRenderer.java where renderFrame() is called to draw the current frame. FYI I used "system.currentTimeMillis()" and a very simple code.

I anybody has the same problem, don't hesitate to contact me and I will try to help you.

Bes regards!

Frame Rate of my application

August 24, 2012 - 2:52am #4

Use the C Time library to get the current time in microseconds.

You might find this thread useful

http://www.unix.com/programming/1991-time-microseconds.html

N

Frame Rate of my application

August 22, 2012 - 9:12am #3

Hi Nalin,

Do you mean renderframe in ImageTargets.cpp? How can I acces to "time" information there? 

I was thinking in include the calculations in updateRendering() by substracting the Initial_time from the Current_time and then this (1/result) *num_frames.

But my problem is to get the time information. Any idea?

Thanks!

Frame Rate of my application

August 22, 2012 - 5:21am #2

Hi annAR

There are various approaches for getting the rendering frame rate, based around calculating time variations in renderFrameQCAR()

You might also find this link helpful: http://stackoverflow.com/questions/87304/calculating-frames-per-second-in-a-game  

N

Log in or register to post comments