0

I want to measure for experimentals purposes FPS, FT and Polygon count and other graphics parameters on worlds/games created for the Web from UNity (information like what is the average FPS or FT, minimum, maximum- all these statistics). In other words, how I can measure FPS,FT and Polygon count ... for WebGL worlds and Unity worlds on the web?CPU Utilization, GPU Utilization and Memory would good things to measure also. Is there any tools to do this? Knowing that I need to draw CDF (cumulitive Distributions Functions) and probability dist graphs for this. I know there is the Chrome DevTools and Firefox Devtools but they are quite complicated. In case they are helpful in your opinion (although I don't think so) is there any easy tutorial/book that teach me how to do exactly this?

gman
  • 100,619
  • 31
  • 269
  • 393
HB87
  • 413
  • 7
  • 16

1 Answers1

0

In order to check the frame times, simply read Time.deltaTime inside Update, it's always the time from the last frame. For fps, the only way that I know of, is to wait a second, counting every frame (on update, just add 1 to a frame counter) and the time it took (deltaTime), when delta time reaches 1sec or surpasses it, divide time/frame count. I don't know how you can get the polygon count, but you can see it in the profiler, so it should be possible(?).

for example:

int frameCounter;
float totalFrameTime, fps;
void Update()
{
  frameCounter++;
  float frameTime = Time.deltaTime;
  totalFrameTime += frameTime;
  if (totalFrameTime >= 1) //or 2 or 3
  {
     fps = totalFrameTime / frameCounter;
     frameCounter = 0;
     totalFrameTime = 0;
  }
}

For cpu utilization, you could use .NET libraries see this

RaidenF
  • 3,411
  • 4
  • 26
  • 42