Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Framerate Capping, and VSync. Educate me

Discussion in 'Scripting' started by Nanako, Oct 2, 2014.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    hello folks, this is a line of discussion spilled over from another thread.

    One thing i would like to do in the future, is to develop a game which offers a consistent framerate. My game will, by design, switch suddenly and violently between high and low intensity, in terms of what's happening on screen, and how much has to be processed. But i would like players to not be shocked by this and not experience sudden FPS drops during intense situations.

    The best way i see of doing this, is to make the game maintain a static, constant framerate throughout. Much like nintendo does with their games, set at a value that the client's computer can handle even in the most intense situations, so that there's no change in smoothness when things get frantic. I'm a little fuzzy on how this all works though.

    Ideally, some way of modifying this value to higher numbers, for higher end hardware, would be good too. But my watchword first and foremost is a consistent experience, not the highest fps possible at any given moment.

    Can anyone fill me in on the subject?
     
    Last edited: Oct 2, 2014
  2. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    http://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

    This will prevent your game from running over the set target frame rate.

    Also, if your scene is "too frantic" and still drop under the target, you may want to look into optimization.
    Usually, one would give the user access to some parameters like shadow quality to be adaptive to the hardware.
     
    Nanako likes this.
  3. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
  4. cranky

    cranky

    Joined:
    Jun 11, 2014
    Posts:
    180
    The point of vsync is to render at the same rate as your monitor refreshes. In the previous thread, you said it was capping at 60 fps. This means that your monitor is running at 60 hz. When attempting to change the display's image faster than it can support, you can end up with screen tearing.

    http://en.wikipedia.org/wiki/Screen_tearing