Search Unity

Official ARFoundation v3.0

Discussion in 'AR' started by tdmowrer, Aug 29, 2019.

  1. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    164
    @mistergreen2016 If you want to use ARCore Cloud Anchors with ARFoundation then add the following package:

    https://codelabs.developers.google.com/codelabs/arcore-extensions-cloud-anchors/#0

    It should work cross platform with iOS and Android (have only tested this package with Android myself though).
     
    Thimo_ likes this.
  2. mdurand

    mdurand

    Joined:
    Aug 1, 2016
    Posts:
    45
    We recommend Google's AR Foundation extension package if you are interested in using ARCore Cloud anchors: https://developers.google.com/ar/develop/unity-arf
     
    rogueyoshi likes this.
  3. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Cool, I wasn't sure if ARCore Cloud anchor was iOS compatible.
     
  4. VagantB

    VagantB

    Joined:
    May 28, 2019
    Posts:
    6
    hallo,
    we trying to Work with CollaborationData,
    The ARCollaborationDataExample scene works just fine.
    the transform of the shown object is sent, so is
    there a way to add more data or just a variable to it.
    .
     
  5. WayneVenter

    WayneVenter

    Joined:
    May 8, 2019
    Posts:
    56
  6. WayneVenter

    WayneVenter

    Joined:
    May 8, 2019
    Posts:
    56
    Actual log:
    FormatException: Input string was not in a correct format.
    System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Single.Parse (System.String s) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.XR.ARKit.ARObjectInfo.GetWithDefault (System.Collections.Generic.Dictionary`2[TKey,TValue] dict, System.String key, UnityEngine.Quaternion defaultValue) (at C:/Unity/arfoundation-samples-master/Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.1/Editor/ObjectTracking/ARObjectInfo.cs:118)
    UnityEditor.XR.ARKit.ARObjectInfo..ctor (System.Xml.XmlDocument plist) (at C:/Unity/arfoundation-samples-master/Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.1/Editor/ObjectTracking/ARObjectInfo.cs:39)
    UnityEditor.XR.ARKit.ARObjectImporter.ReadInfo (System.String path) (at C:/Unity/arfoundation-samples-master/Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.1/Editor/ObjectTracking/ARObjectImporter.cs:96)
    UnityEditor.XR.ARKit.ARObjectImporter.ReadARObject (System.String path) (at C:/Unity/arfoundation-samples-master/Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.1/Editor/ObjectTracking/ARObjectImporter.cs:46)
    UnityEditor.XR.ARKit.ARObjectImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at C:/Unity/arfoundation-samples-master/Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.1/Editor/ObjectTracking/ARObjectImporter.cs:29)
    UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at <83a73882c51c4602b3d34743827d03e7>:0)
    UnityEditorInternal.InternalEditorUtility:projectWindowDrag(HierarchyProperty, Boolean)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  7. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Hello. Does adding an ARPointCloudManager in my scene will improve the tracking of an ARAnchor ?
     
  8. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    How can we include AR Foundation 3.0.1, but still target a build for iOS 10.0? I want AR functionality on devices that support ARKit, and will offer up alternate content for older devices. The docs say that we can set the ARKitSettings to Optional, to support all devices. (https://docs.unity3d.com/Packages/com.unity.xr.arkit@3.0/manual/index.html#build-settings)

    However, I receive this error when setting the Target Minimum iOS Version to 10.0:

    BuildFailedException: You have selected a minimum target iOS version of 10.0.0 and have the ARKit package installed. ARKit requires at least iOS version 11.0 (See Player Settings > Other Settings > Target minimum iOS Version).

    Using Unity 2019.2.9 w/ AR Foundation 3.0.1

    Any thoughts?
     
    Cromfeli likes this.
  9. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    You can't get around this.
     
  10. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    I have used ARKit within an iOS app in the past that targeted iOS 10, but without AR Foundation. It was just the direct AR Kit plugin. I just detected if it was supported or not, and then loaded the appropriate scene.

    Hoping there is a similar way with AR Foundation. The docs that I referenced above appears to indicate there is a way.
     
    Cromfeli likes this.
  11. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Does anyone know what version of AR Foundation / ARKit stopped allowing the ability to publish to iOS 10?

    [UPDATE] It appears that it will publish to older iOS version if using ARFoundation version 2.0.2, which is Unity 2019.2 Verified.
     
    Last edited: Feb 5, 2020
    Cromfeli likes this.
  12. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Unity 2019.2.9 does successfully build to iOS10 using ARFoundation 2.0.2. However XCode fails when building to device with the error...

    Unable to install. Requires the "arkit" capability which is not supported by [PHONE_NAME]

    Shouldn't we be able to build to lower end devices and then do our own AR detection and serve up the appropriate scene if unsupported.
     
    Cromfeli likes this.
  13. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    This says it. Some ARKit function can't be supported on iOS 10.
     
  14. sam_cygnops

    sam_cygnops

    Joined:
    Dec 16, 2019
    Posts:
    4
    Hi I build an App with both Ground Tracking and Face Tracking and made a button which switches between them. The Problem is with the performance the Ground tracking which works on Rear camera gives 30 fps where as when i am using Face Tracking which uses Front Camera the fps drops to 20 fps which gives a lot of lag. Can you please help how should i increase the fps of the front camera face tracking.
     
  15. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Cromfeli likes this.
  16. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    sure you can do that. It doesn't mean ARkit will work on iOS 10.
    Code (CSharp):
    1. If ARKit is set to optional, the app may be installed on a device that does not support ARKit.
     
  17. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Yep, correct. I will serve up alternate content on those lower end devices.
     
  18. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Oh, you should have said that to begin with.
     
  19. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    I did above. :)
     
  20. eldercrain

    eldercrain

    Joined:
    Sep 2, 2018
    Posts:
    2
    Is Object tracking still an iOS only thing? The current documentation is confusing with the example projects on github saying the example requires iOS, but the manual seemingly implying that the functionality should work overall.
     
  21. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    ARCore does not seem to support this at this time so it will not work on android.
     
  22. MarcoElz

    MarcoElz

    Joined:
    Jan 28, 2017
    Posts:
    17
    Hello,
    I am upgrading my app from an old version of ARFoundation.

    I got an error when I tried to build Asset Bundles using the Asset Bundle Browser. I can make a build and export it to iOS, but I need to be able to build Asset Bundles as before.

    The log is:

    Code (log):
    1. Plugin 'UnityARKit.a' is used from several locations:
    2. Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1100/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
    3. Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
    4. Please fix plugin settings and try again.
    How can I delete the Xcode1000 plugin?

    I am using ARKit XR Plugin version 3.0.1, and Unity 2019.3.4f.
     
  23. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,065
    I also ran into the "Plugin 'UnityARKit.a' is used from several locations" issue today.

    The ARKitBuildProcessor in the com.unity.xr.arkit package is responsible for selecting the proper version but it is wrapped in
    #if UNITY_IOS
    , which is a bad idea for editor code.

    The reason is that UNITY_IOS is set based on the active build target but editor code does not get recompiled if you compile for another build target via
    BuildPipeline.BuildPlayer
    .

    i.e. if your active build target is Android and you start an iOS build using
    BuildPipeline.BuildPlayer
    , then all editor code that is wrapped in
    #if UNITY_IOS
    will not be executed!

    The quickest workaround is to make sure your active build target is iOS before doing an iOS build.

    However, it would be better for Unity to switch to a dynamic build target check that does not rely on
    #if UNITY_IOS
    , or at least implement a check that errors out in that case.
     
  24. lidia-thomas

    lidia-thomas

    Joined:
    Mar 18, 2020
    Posts:
    1
    @tdmowrer @todds_unity
    I wanted the same thing as the OP : get Session pointer from Unity and pass it on to a Java/Kotlin library. The docs referenced would give me a void* pointer to session - how do I use that from the Java/Kotlin side of things? If there is an example repo out there, would love to get a link. @amichai2 did you get this working?

    thx
     
  25. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    You can use native pointers with the native APIs on the respective platforms. See ARCore API and ARKit API.
     
  26. AugmentedSpaceAgency

    AugmentedSpaceAgency

    Joined:
    May 11, 2017
    Posts:
    12
    Hi @steego, we are encountering the same errors after upgrading from ARFoundation 2 to 3. Did you found any solution?
     
  27. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    Not really no, the errors didn't impact any functionality for me, so I just ignored them.
     
  28. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    ARCore is now in 1.16 for Unity. Can we use it within ARFoundation ?
    Can I download ARCore 1.16 and upgrade my ARFoundation ? (because ARFoundation use 1.12)
     
  29. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Does ARFoundation Team has an issue tracker ? Like a Github issue page ?

    I want to add this suggestion :
    When using ARCore ImageLibrary it gives us a "score" of the picture :
    upload_2020-4-6_13-55-25.png

    But in ARFoundation it does not give the "score". I would love to see the score in ARFoundation !

    upload_2020-4-6_13-55-39.png
     
  30. Pixygon

    Pixygon

    Joined:
    May 9, 2013
    Posts:
    26
    I have a couple of issues when building to iOS.
    Using Unity 2019.3.7f1, all ARFoundation packages at 4.0.0 preview 1, but experienced error with earlier packages too.

    First, it crashes on launch, because it's lacking an image tracking library(and object tracking):
    InvalidOperationException: Cannot start image tracking without an image library.

    We aren't using any library atm. and would love to be able to build without going into the ARLoader-script and commenting out everything related to ImageTracking/ObjectTracking

    Another issue I get, blocking the build in Unity is the ARKitLWRPBackground, not finding LWRP, since we are using URP. Can be solved by having both URP and LWRP in project, or replacing the "LWRP"-bit in the shader with "Universal", but thats messy!
     
  31. Pixygon

    Pixygon

    Joined:
    May 9, 2013
    Posts:
    26
    Problem with imagetracking still happens, even with an imagetracking library set to the correct component, or when i don't have the component at all, really annoying!
     
  32. Farianto

    Farianto

    Joined:
    May 15, 2018
    Posts:
    5
    Brother Is it possible to put our 3D Object (Human) binding on The Terrain in AR mode.? I mean when i shoot the Image Target with my android phone then it wil show me the model (3D Human) stand on The Terrain ...
     
  33. elhongo

    elhongo

    Joined:
    Aug 13, 2015
    Posts:
    47
    Hello,

    I am using Unity 2019.3.5f1 + URP 7.2.0 + ARFoundation 3.0.0 for an AR project on Android/iOS.

    I am using PostProcessing for some 3D objects, and I want the postprocessing not affecting the camera feed from ARFoundation. How would I accomplish that?
    Suggestions here didn't resulted to me: https://forum.unity.com/threads/urp...essing-exclude-the-arcamerabackground.811254/

    I see we could do something similar to this (https://github.com/Unity-Technologies/UniversalRenderingExamples/wiki/3D-Skybox), rendering cameras in the anti natural order. But would that work with the ARFoundation's ARBackground RendererFeature?
    It seems it doesnt work, in mobiles ARBackground renderer feature (in Overlay Camera) renders everything and overwrites the result of Base camera (no matter what the Stencil Buffer has).

    Thanks!
    Pablo
     
    Last edited: Apr 8, 2020
  34. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Post processing slows down the frame rate of AR, especially when it's set to post process 'global'. You'll have to use by 'volume'.
     
  35. elhongo

    elhongo

    Joined:
    Aug 13, 2015
    Posts:
    47
    Yeah.. we are using Volume
     
  36. darger

    darger

    Joined:
    Aug 30, 2012
    Posts:
    17
    AR Foundation 3.1.0 preview version implemented ARKit3 related features such as HumanBodySubsystem and OcclusionSubsystem, but in 3.1.3 all those features have been removed! why? Those seems that in the preview version of 4.0.0 is back again.
    Nothing is written about this in the ChangeLog either. I am confused. I need explanation.

    We have already released an app that implements people occlusion. What should we do? Should we continue to use the preview version of 3.1.0? Should we move to the 4.0.0 preview version? Is there a possibility that these features will be removed in the future?
     
  37. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Hello.
    AR Foundation 3.0.1 documentation says
    But when, in the hierarchy, I do Right Click => XR=> Session Origin
    It add a ARSessionOrigin GameObject with a Camera with a ARPoseDriver. Not a TrackedPoseDriver. Should I remove the ARPoseDriver and add the TrackedPoseDriver ? Or should the documentation be updated ?
     

    Attached Files:

  38. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    ARPoseDriver is a recent component to replace TrackedPoseDriver for AR. TrackedPoseDriver is a generic driver for AR & VR.
     
  39. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    This is an unfortunate artifact of our internal package publishing processes between verified and preview packages.

    ARHumanBodyManager and AROcclusionManager exist in the latest 4.0.0-preview.3 packages, and we are working to include them in the forthcoming 4.0.x verified packages.
     
    darger likes this.
  40. darger

    darger

    Joined:
    Aug 30, 2012
    Posts:
    17
    Thank you for your reply. It would have been nice if such information was included in the Change log.
     
  41. sroq

    sroq

    Joined:
    Jun 28, 2015
    Posts:
    13
    Hi,

    Which version of ArFoundation and ArKit compatible with Unity 2019.4LTS and Xcode 11.5

    I tried these combos:
    1. ARFoundation 2.1.8 + ArKit 2.1.9, result: black screen on iOS device (ver 13.3.1)
    2. ARFoundation 3.1.3 + ARKit 2.1.9, result: lot of error in Unity Editor
    3. ARFoundation 3.1.3 + ARKit 3.1.3, result: black screen on iOS device (ver 13.3.1)

    Camera usage description is set.

    thank in advance

    RESOLVED! the problem was I missed URP settings: https://forum.unity.com/threads/con...-0-0-preview-to-work-with-lwrp-or-urp.736583/
     
    Last edited: Jun 10, 2020
  42. KeithT

    KeithT

    Joined:
    Nov 23, 2011
    Posts:
    83
    Hi,

    I am trying to change the prefab referenced in Face Prefab (or update its materials) on AR Face Manager at runtime. (AR Foundation 4.1.0 Preview 6). The only way I've managed to make this work is to set the AR Session Origin game object to false and then set it back to true. This works but it's bit naff as a user experience, as the screen goes black for about 1 sec as the session restarts. Anyone know more elegant approach to this?

    Thanks in advance
    KeithT
     
  43. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    Ok this is incredibly frustrating!

    I have black screen issue.

    Started with URP template.
    UniversalRenderPipelineAsset created
    UniversalRenderPipelineAsset_Renderer created
    NewARBackgroundRendererFeature created and set.
    NewARBackground.JPG URPSettings.JPG



    In Build settings:
    Checked AR Kit under XR Plugin-Management
    Player -> Requires ARKit support checked
    Player -> Camera Usage Description has text.
    Target Device iPad + iPhone
    Minimum iOS version 11
    configARKitRequired.JPG xrArKitActivated.JPG


    Packages Installed (Package Manager):
    AR Foundation 3.1.3
    AR Core XR Plugin 3.1.5
    ARKit Face Tracking 3.1.3
    ARKit XR Plugin 3.1.3
    Universal RP 8.2.0
    installedPackages.JPG


    Unity Version 2020.1.2f1 Personal


    Can someone _please_ help? I've spent hours today trying this on multiple platform combinations. What the hell is going on? Why is this such a PITA. This is the type of configuration sphaghetti that really makes me hate Unity's approach. Please help me learn to love Unity.

    Any suggestions?
     
  44. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,139
    Please pass the reference to URP here:
     
  45. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    Good catch. I just did this and made a new build, but it still seems to show black. I'm removing the app and doing a new build now. Lets hope it fixes it.

    P.S. Ive been eyeing your toolset today. Likely you'll have another customer (I develop on a windows machine mainly and have to built on xcode).
     
    Last edited: Aug 17, 2020
  46. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20

    Hey Kiril. Still having this issue. Still black. I've set the rendering pipeline in both Quality -> Rendering and Graphics -> Scriptable Render Pipeline Settings
     
  47. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,139
    Please make sure that you've assigned the URP reference to the Quality settings that are default for your target platform.
     
  48. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    Ahah! That was the issue. Damn. So many gotcha's with Unity compared to Unreal.

    Thank you so much Kirill!
     
    KyryloKuzyk likes this.
  49. simakovmail

    simakovmail

    Joined:
    Dec 28, 2020
    Posts:
    1
    Hello. Did you manage to solve this ?