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

ipad mini 2 fps problem

Discussion in 'iOS and tvOS' started by caseyboundless, Apr 16, 2014.

  1. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
    EDIT: Found the problem. Some reason I had a fps javascript attached instead my c# script from the wiki. Weird. Small but painful problem. lol



    Has anyone with a ipad mini 2 reached a problem with Application.targetFrameRate = 60;
    Mine will not go over 30fps on a blank scene.
     
    Last edited: May 2, 2014
  2. zehreken

    zehreken

    Joined:
    Jun 29, 2009
    Posts:
    112
  3. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
    i have tried every combination on vsync in the editor. It will not go to 60fps on the ipad mini 2. It works in editor and webplayer.
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We couldn't reproduce your issue. Could you please double-check if this code line is actually executed in your project and there is no other code place where it would override it.
     
  5. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590

    I can later today but here is my script. My ipad mini 2 hits a limit of 30fps on blank scene with a camera and this script only.

    Code (csharp):
    1.     using UnityEngine;
    2.     using System.Collections;
    3.      
    4.     public class FPS : MonoBehaviour
    5.     {
    6.        
    7.         // Attach this to a GUIText to make a frames/second indicator.
    8.         //
    9.         // It calculates frames/second over each updateInterval,
    10.         // so the display does not keep changing wildly.
    11.         //
    12.         // It is also fairly accurate at very low FPS counts (<10).
    13.         // We do this not by simply counting frames per interval, but
    14.         // by accumulating FPS for each frame. This way we end up with
    15.         // correct overall FPS even if the interval renders something like
    16.         // 5.5 frames.
    17.        
    18.         public  float updateInterval = 0.5F;
    19.        
    20.         private float accum   = 0; // FPS accumulated over the interval
    21.         private int   frames  = 0; // Frames drawn over the interval
    22.         private float timeleft; // Left time for current interval
    23.        
    24.         void Awake()
    25.         {
    26.             Application.targetFrameRate = 60;
    27.        
    28.         }
    29.      
    30.      
    31.      
    32.      
    33.         void Start()
    34.         {
    35.             if( !guiText )
    36.             {
    37.                 Debug.Log("UtilityFramesPerSecond needs a GUIText component!");
    38.                 enabled = false;
    39.                 return;
    40.             }
    41.             timeleft = updateInterval;  
    42.         }
    43.        
    44.         void Update()
    45.         {
    46.             timeleft -= Time.deltaTime;
    47.             accum += Time.timeScale/Time.deltaTime;
    48.             ++frames;
    49.            
    50.             // Interval ended - update GUI text and start new interval
    51.             if( timeleft <= 0.0 )
    52.             {
    53.                 // display two fractional digits (f2 format)
    54.                 float fps = accum/frames;
    55.                 string format = System.String.Format("{0:F2} FPS",fps);
    56.                 guiText.text = format;
    57.                
    58.                 if(fps < 30)
    59.                     guiText.material.color = Color.yellow;
    60.                 else
    61.                     if(fps < 10)
    62.                         guiText.material.color = Color.red;
    63.                 else
    64.                     guiText.material.color = Color.green;
    65.                 //  DebugConsole.Log(format,level);
    66.                 timeleft = updateInterval;
    67.                 accum = 0.0F;
    68.                 frames = 0;
    69.             }
    70.         }
    71.     }
     
  6. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Script looks bit complicated :)
    In Xcode 5.0 or later you can switch to Debug Navigator View and watch actual fps, CPU and GPU usage. Do you see 30 fps here too?
     
  7. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
    debug navigator says 30fps here is my quality settings.
     

    Attached Files:

    Last edited: Apr 18, 2014
  8. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
  9. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    It does not look like it would be bound neither by CPU nor GPU. Most likely configuration or Xcode project problem. Please submit it as bug report for investigation. Thanks!
     
  10. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
    Ok
     
  11. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
  12. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    49
    and how you did that?
     
    MrEsquire likes this.
  13. caseyboundless

    caseyboundless

    Joined:
    Oct 17, 2011
    Posts:
    590
    I edited the first post some time ago. Read the edit.