Search Unity

ARFoundation on iOS is Camera framerate locked to 30fps?

Discussion in 'Handheld AR' started by hawken, Nov 27, 2018.

  1. hawken

    hawken

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

    tdmowrer

    Unity Technologies

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

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    475
    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

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    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.
     
    hawken likes this.
  5. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    475
    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

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    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

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    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.
     
    hawken likes this.
  8. hawken

    hawken

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

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    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:
    4
    How are you recording the screen. iOS has a built-in way to do this, which works pretty well for me.
     
  14. JoMaHo

    JoMaHo

    Joined:
    Apr 2, 2017
    Posts:
    94