Search Unity

Low FPS

Discussion in 'Editor & General Support' started by crobertson, Jul 22, 2019.

  1. crobertson

    crobertson

    Joined:
    Feb 5, 2015
    Posts:
    14
    I have been developing a game for a few weeks now and I am starting to focus on performance and I have noticed that with an empty scene in the unity stats graphic while playing I only reach between 375-450FPS while I see other people reaching 1500+FPS. I am using a fairly good laptop to run the game Lenovo ThinkPad P52S.

    When I add a FPS counter script and I load my second scene where you start actually doing some major actions my FPS on the counter script drops from 60FPS to 20FPS keep in mind this is while running on the Oculus Go. When in the unity editor I run that same scene that goes to 20FPS (on the oculus go) it runs between 30-40FPS (in the editor). When I remove every object from my scene and no scripts are running other than the FPS counter I am able to get between 70-90FPS (in the editor).

    The issue is I know Oculus requires 60FPS for Oculus Go games and apps, how strict are they on this? Once you get into the main part of the game where it hits 20FPS on the Oculus Go it still plays well and it doesn't seem to lag much for me but that's what the script is counting so I have to agree that it really is 20FPS right?

    I have tuned down all my quality and graphics settings to the lowest I can and even deleted my skybox and changed the cameras to notice solid colors rather than skybox. I am also using the OVRCameraRig that comes with the Unity Integration but even when I shut that off it really doesn't make to much of a difference to my FPS.

    I am kind of new to the stats graphic so if something looks funny within there please let me know!

    Thanks for any information that can be provided.
     

    Attached Files:

  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    That laptop doesn't strike me as a "VR Ready" rig. Specifically, the GPU looks to be fairly underpowered for VR. From the following link, the P500 in your laptop isn't really on the list, but it would likely be listed lower than other cards that aren't VR Ready.

    https://www.nvidia.com/en-us/design-visualization/quadro-in-laptops/

    So, given your setup, I probably wouldn't expect you to have a lot of success with VR development.

    But to be sure, you'll need to profile your game. Open the Profiler (Window -> Analysis -> Profiler) and run the game. You can then determine which elements of your game as taking a long time, and ideally learn to correct them. However, it's also highly likely that it's not a CPU-bound issue with your scripts, and instead it could be a GPU-bound issue due to your graphics card.
     
    Joe-Censored likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Quadro P500 was considered an entry level workstation GPU in 2017.

    In editor performance numbers are rather meaningless by the way.
     
  4. crobertson

    crobertson

    Joined:
    Feb 5, 2015
    Posts:
    14
    I could understand the laptop not being "VR Ready" or able to run games for like the rift. However I am creating a "VR Game" for Oculus Go. With that being said lets say I developed a game on this laptop even if it did not run well on my laptop because it isn't necessarily a grade A laptop for game development once I build it and run it on my Oculus Go it should run better than it would on my laptop, right?

    If that is true then why is it that it runs at 45 FPS (data collected from fps counter script not from editor statistics) on the laptop in editor and when I build and run the game onto the Oculus Go I am getting 20-30 FPS (data collected from fps counter script not from editor statistics)?
     
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Yeah, you can develop the VR game on a lower-end machine, and have it run much better on a higher end machine. The risk is that you might never really know if you've got the framerate running acceptably even on a higher-end machine if you can't test it yourself on such a machine. But in general, sure, you can do it that way.

    The only reliable way to know what's eating up your FPS, though, is to profile a build of your game. Profiling in the editor can give you some good ideas about what's taking the time, but it's not as reliable as profiling a built copy of your game. Build the game as a Development Build, run the exe, and then attach Unity's profiler to it. Then, when the game's running slow, inspect the frame, and see what's taking all the time. For any serious development with Unity, there's really no getting around becoming familiar with the profiler.

    Also, just to avoid an obvious mistake, make sure you're not doing a lot of Debug.Log. Doing a single Debug.Log in an Update statement, every frame, is usually enough to kill the performance of a game.