Method that counts the frames of an Augmented Reality scene in C #

2

I'm doing an Augmented Reality job using Unity and Vuforia and I need to capture how many frames the scene I'm developing is using, I do not dominate much of C #, but my research apparently does not have any getFrame () method like ARToolKit can someone help me?

    
asked by anonymous 27.08.2015 / 15:33

1 answer

2

One way to find these values in Unity is to use the Update() method, it is built into the tool and is called each time a frame is created. To know the total number of frames that were generated, we can create a variable and add 1 to each method call.

int frame; //total de frames criados

Update(){
  frame++;
}

And to know fps we can take the inverse of the time variation between each call

float deltaTime = 0.0f;
float fps = 0.0f;

void Update()
{
    deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
    fps = 1.0f / deltaTime;
}

You can use these variable values and work as you like.

  

About the Update function link

     

Some Unity FPS deployments: link

    
01.09.2015 / 08:22