Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ARFoundation on iOS is Camera framerate locked to 30fps?

Discussion in 'AR' started by enhawk, Nov 27, 2018.

  1. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Is this running at a lower frame rate than normal ARKit?
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    ARFoundation does not set or require a particular framerate, no. You might try setting it explicitly.
     
  3. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Could it be the camera framerate? With ARCore it's locked to 30 fps. In UnityARKitPlugin it runs at something much higher, but in ARFoundation it seems more like 30 on iOS
     
  4. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    UnityARKitPlugin sets Application.targetFrameRate to 60 in several of the examples and the UnityARCameraManager. ARFoundation leaves it up to you to set the frame rate (rather than enforce a specific one). The frame rate in Unity defaults to 30 on mobile, so if you don't set it, it will likely be 30 fps.
     
    enhawk likes this.
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Sorry, I mean the camera. I don't think it's the application framerate.

    I understand that older ARkitr might run the camera slower? ARCore runs it at 30 fps.

    You can see the difference for yourself by building an empty iOS ARFoundation project and an empty UnityARKitPlugin project, the camera update speed (?) difference is noticeable.
     
  6. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Might have to do with the ARWorldTrackingConfiguration's videoFormat property, which can affect the framerate. We don't set it explicitly. I'll investigate.
     
  7. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    In ARFoundation, setting Application.targetFrameRate to 60 gives me a solid 60 Hz framerate on iOS, according to the Unity profiler. I looked at the videoFormats that I mentioned, and they are all 60 Hz, so it's not possible to select 30 Hz at the ARKit level.

    Visually comparing the result to the UnityARKit plugin on Bitbucket, I can't tell any difference.

    If, however, I do not set the Application.targetFrameRate to 60 and leave it at the default of 30, then the difference is quite noticeable.
     
    enhawk likes this.
  8. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
  9. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    You will be able to enumerate and set the coffee format on the next release. However, ARKit chooses the highest resolution one by default, so this would only allow to to choose a lower resolution.
     
  10. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94
    I have a question about the video texture quality; I record my AR session at 1080p on my iPhone XR, but the video background looks like it is poorly encoded or something. Any possibility to increase texture quality?
     
  11. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Hey guys

    Can anyone clarify the whole FPS target for ARCore and ARKit... I was watching the Unite LA performance related videos and came across this one, recommending 30FPS for AR apps.. and says most studios are targeting this now.



    But I keep reading ARKit targets 60FPS anyway.. and ARCore 30FPS.

    So should/shouldnt we override it? I had also read in numerous places, overriding it to 60 on IOS improves the tracking?

    ARFoundation defaults to 30fps for both right? So whats your thoughts on leaving that alone? And does that limit ARKit to 30 also... I am finding after some playtime, my Samsung S8 seems to do some Thermal Throttling... And Im currently targeting 60FPS on both.

    Thanks
     
    newguy123 likes this.
  12. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94
    Anyone have ideas on how to get less compressed (higher quality) 1080 video recordings of an AR session?

    @tdmowrer any suggestions?
     
  13. mekin

    mekin

    Joined:
    Mar 5, 2019
    Posts:
    11
    How are you recording the screen. iOS has a built-in way to do this, which works pretty well for me.
     
    nivrefilm likes this.
  14. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94