How is Lerpz 300 FPS?

Whilst working on my own project, which is meant to be very cross platform friendly, as well as available for use on even lower tier computers, I realised that the current FPS I’m getting on my first level averages at about 68 FPS, which is very nice in most contexts, however when doing the lerpz tutorial I remembered my FPS averaged at around 300 or so, which is absolutely ridiculous, how on earth did they manage to make it so efficient? The Lerpz tutorial has more than 5 times the vert count of my own level, and more draw calls, how is it doing this?

The project I'm currently working on doesn't have terrain, it generates the level randomly from 100 tiles. Each tile is around 50 tris, the Lerpz tutorial uses 30mb of textures on average and with only 2 visible skinned meshes, whereas mine uses 4mb of textures and only 1 visible skinned mesh, sorry if none of this information is of any use, just using the statistics window.

((I retaged 'fps' to 'framerate' to avoid confusion with first-person-shooter))

2 Answers

2

vsync maybe? why not load up the profiler and see where your cycles are going?

Where would I go, and what would I need to do, to do that?

You need Pro to use the profiler. But just go to Window - Profiler if you have pro. It will slow down your FPS in the statistics box while it is running, but it also has an FPS counter that takes the profiler out of the equation. Also, I would recommend turning on deep profiling. It breaks down each script and tells you where the most time is being spent. Again, this assumes that you have Pro.

I'm voting for this being a vsync problem too. Ensure that it is set to "Don't Sync" in Edit->Project Settings->Quality, checking under the "Good" tab, since that it is the default quality setting.

The Frames per second you get in the stats window isn't your actual frames per second so don't rely on it.

Unless you have an amazing graphics card and a 600Hz plasma TV your obviously not going to get 300 fps. Its near impossible and most monitors can only handle 60.

If you want your ACTUAL frames per second, create a GUI Text and attach this script to it:

// Attach this to a GUIText to make a frames/second indicator.
//
// It calculates frames/second over each updateInterval,
// so the display does not keep changing wildly.
//
// It is also fairly accurate at very low FPS counts (<10).
// We do this not by simply counting frames per interval, but
// by accumulating FPS for each frame. This way we end up with
// correct overall FPS even if the interval renders something like
// 5.5 frames.

var updateInterval = 0.5;

private var accum = 0.0; // FPS accumulated over the interval
private var frames = 0; // Frames drawn over the interval
private var timeleft : float; // Left time for current interval

function Start()
{
    if( !guiText )
    {
        print ("FramesPerSecond needs a GUIText component!");
        enabled = false;
        return;
    }
    timeleft = updateInterval; 
}

function Update()
{
    timeleft -= Time.deltaTime;
    accum += Time.timeScale/Time.deltaTime;
    ++frames;

    // Interval ended - update GUI text and start new interval
    if( timeleft <= 0.0 )
    {
        // display two fractional digits (f2 format)
        guiText.text = "" + (accum/frames).ToString("f2");
        timeleft = updateInterval;
        accum = 0.0;
        frames = 0;
    }
}