- Home /
Building my own benchmarking program
So, I'm doing some research for my next game. I want to know how many polys the Web Player can take. I make an empty scene and made a script that instantiates an object with 1000 triangles every .01 seconds. It will instantiate it within a box 200 units wide. I have the camera going around in an animation pattern.
You can play it here: https://dl.dropboxusercontent.com/u/33872519/FR%20Test%20Build/FR%20Test%20Build.html
This should give me an OK benchmarking program, right? I mean, I know that AI scripts and the like will slow it down, but this is a good ballpark, right?
Script below (in UnityScript): #pragma strict
var object : GameObject[];
var guiVerts : GUIText;
var waitTime : float;
var numOfVerts : int = 0;
var theBox : float;
private var goAhead : boolean = true;
private var wereDone : boolean = false;
function Update ()
{
guiVerts.text = "Number of Vertices: "+numOfVerts.ToString();
if(Input.GetKeyDown("escape"))
{
wereDone = true;
Debug.Log("escape");
}
if(goAhead)
{
SpawnObject();
}
}
function SpawnObject()
{
goAhead = false;
var modelNumber = Random.Range(0, 3);
var randomNumX = Random.Range(-theBox, theBox);
var randomNumY = Random.Range(-theBox, theBox);
var randomNumZ = Random.Range(-theBox, theBox);
var pos : Vector3 = Vector3(randomNumX, randomNumY, randomNumZ);
var clone = Instantiate(object[modelNumber], pos, transform.rotation);
numOfVerts += 1000;
yield WaitForSeconds(waitTime);
if(wereDone == false)
{
goAhead = true;
}
}
Over 4 million vertices. Still a constant 30 FPS. I don't think this is a good benchmark (not trying to be mean - honest opinion). $$anonymous$$aybe you should add some more scripts that do complicated maths and stuff. I don't know but I dont think that using Unity for this stuff is appropriate. $$anonymous$$aybe try another program to do this stuff.
Ok, I might look for some other benchmarking program using Unity. But I think Unity is the right tool for the job, because I want to know how Unity handles that number of verts, not my computer. Thanks!
The number of vertices/triangles and it's impact on performance is very clearly dependent on the system. Generally the Unity Web Player and a desktop build are just as fast in stuff like this.
Answer by Kiloblargh · Jun 29, 2013 at 04:56 AM
No, it's not a good benchmark.
Graphics cards these days can do a quijillion triangles per second- that's not the bottlneck at all. High draw calls from multiple materials and animating multiple skinned meshes are what are going to slow a game down. And OnGUI. And big loops in Update that check distances and such.
But your test scene isn't testing any of those things so it isn't really testing anything.
Ok, thanks for the information. Do you know of a good tool I can used to benchmark $$anonymous$$e and some of my friends machines so I know about how many polys I can have in a scene?
Thanks for the help!