Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

3.4 FPS Limiting?

Discussion in 'Editor & General Support' started by Farfarer, Aug 4, 2011.

  1. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    Not sure what's happening but I've noticed that my scene, which ran at ~275 FPS or more in Unity 3.3 is now capping out at around the 60 mark.

    60 FPS is plenty and I'm not noticing much slowdown, but I'm not sure why this would be.

    It's been kind of handy seeing the FPS drop from the thousand+ mark down to the hundreds as it's been a handy indicator for how costly stuff I put in is. As the profiler is pretty unwieldy for that.

    But at the same time, it's not a flat 60 FPS that a framerate cap would suggest (goes from ~62 to ~75 occasionally).

    This is FPS as reported in the Editor's Stats overlay, btw.

    Any thoughts?
     
  2. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,360
    I've had this happen a few times over the last few months, but luckily not with 3.4. I had to delete all my Unity preferences each time to stop it, but I suggest you try all other alternatives first. Check vsync in the quality settings as a start.
     
  3. vortex69

    vortex69

    Joined:
    Feb 4, 2010
    Posts:
    92
    Disable V-Sync on the quality settings, Edit->Project Settings->Quality->Expand the drop down corresponding to the Editor quality level, by default "Good"->"VSync Count" to "Don't Sync"

    I think that is the problem.
     
  4. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    That was it, must've got set when I updated.

    Cheers guys :)
     
  5. ashish1405

    ashish1405

    Joined:
    Jan 6, 2011
    Posts:
    16
    Hello ppl,

    somehow in (MAC) Editor I get 30 FPS when I set VSync Count to Don't Sync but surprisingly get 60 FPS if I set it to Every VBlank. Which is though less than what I used to get in unity 3.3 (around 80 FPS). Any more suggestions?
     
    Last edited: Sep 5, 2011
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,659
    What about when you actually build your game?
     
  7. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Hi All. I have the same problem, but is NOT the VBlank flag. It happens only on Windows.

    Unity 3.4, tested on Windows 7 64 bit, Windows XP, NVidia cards, ATI cards. I made a simple FPS (UPS) counter and i realize that on Windows (VBLank disabled) Unity does always around 65 fps. Tested the same Project on Mac: 200-300 fps. With VBlank enabled i've got 60 clean fps. Why?

    That is the script:

    using UnityEngine;
    using System.Collections;

    public class FPScounter : MonoBehaviour
    {
    private float elapsed;
    private int counter;

    void Start ()
    {
    counter = 0;
    }

    void LateUpdate ()
    {
    elapsed+=Time.deltaTime;
    counter++;
    if (elapsed>=1.0f)
    {
    elapsed=0;
    Debug.Log(counter.ToString());
    counter=0;
    }
    }
    }

    I always used (in other engines) FPS to check the speed of the code i write. Now, what the heck ... ?!?! :-|
     
  8. aXon

    aXon

    Joined:
    Jul 2, 2011
    Posts:
    17
    Tested on Editor and Build.
    In editor seems to cap the framerate to 65
    If you build and run the resulting framerate is uncapped.

    Seems like the editor, on windows, is always related to VBlank.
     
  9. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Yes! The build is fps unlocked! :p

    Now that my frames per second are around 1100, i noticed a fabulous bug related to a too small Time.deltaTime. Nice.

    BUT, i'd like to be unlocked also in the editor.

    How could i measure real fps? Is there an event just before the update chain?

    Thanks.
     
  10. Schnelle

    Schnelle

    Joined:
    Jan 17, 2011
    Posts:
    89
    Why do you need a special event? Just create a component and attach it to something like the Camera that measures the deltaTime in Update. As long as it always happens in the same place then it shouldn't matter where you put it.
     
  11. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Never mind GameYeti, you're right.

    So, anyone else looking at frame rates in the Editor, on Windows 7? Come on, you're making games, right?
     
    Last edited: Sep 22, 2011
  12. NLSC-E-MS

    NLSC-E-MS

    Joined:
    Jul 22, 2010
    Posts:
    593
    What is the framerate in your profiler?
     
  13. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    Hi PolishRenegade, with that simple project (only a GuiText and the MainCamera) is oscillates randomly between 1500 and 6500 fps.

    With our real current project i have 65 fps in the game panel and a randomly oscillated fps count in the profiler between 800 and 1900. Ok, that is not really realiable as an fps counter :p
     
  14. NLSC-E-MS

    NLSC-E-MS

    Joined:
    Jul 22, 2010
    Posts:
    593
    Just throwing this out there; are you sure the FPS is actually limited in the editor? I haven't tried your code above so sorry if it sounds like a retry... but maybe it's just the stats window acting up; after all the profiler has to "profile" something, and it does so at 800 -> 1900 fps...
     
  15. XeviaN360

    XeviaN360

    Joined:
    Jun 3, 2010
    Posts:
    181
    The Stats window measures the FPS relative only to the Rendering process. It measures how much the rendering takes and calculate a framerate based on it. No matter if your game is using 100% of cpu and is running at 2 fps because is cpu bound. Stats could report you're running at 1000 fps if your render cycle is lite :)

    Anyway, just try that project: it contains only the fps counter (that, as i said, works correctly on MacOSx, and on Windows compiled binaries only, but NOT in game inside the editor)

    http://dl.dropbox.com/u/10375149/FPSCAP.zip
     
unityunity