This is an old revision of the document!
AR Foundation Setup - marker based
- Package manager:
- build setting: switch to target platform
- install AR foundation + ARCore XR from Unity registry in Package Manager
- build setting > Player setting:
- OpenGL before vulkan
- min api : android api level 26 (store 30)
- scripting backend: ILL2CPP
- uncheck armv7 and check arm64
- xr plug-in, check ARCore
- create XR > AR session + AR session origin
- asset > create XR > reference image library (to load marker image)
- ar session origin > add component > ar tracked image manager
- (put library there)
AR Foundation Setup - markerless
- markerless means more task for phone to calculate
- surface detection + motion tracking+ environment lighting
- detection limitation:
- surface w no texture, bad lighting, transparent and reflective surface, moving objects
- build step:
- build setting: switch to target platform
- install AR foundation + ARCore XR from Unity registry in Package Manager
- build setting > Player setting:
- OpenGL before vulkan
- min api : android api level 26 (store 30)
- scripting backend: ILL2CPP
- uncheck armv7 and check arm64
- xr plug-in, check ARCore
- create XR > AR session + AR session origin
- ar session origin > add component > ar plane manager
- outliner > create XR > AR Default Plane, put it prefab
- drag that plane prefab into AR Plane Manager (plane prefab)
- direction mode: horizontal
- ar session origin > add component > ar raycast manager
- ar session origin > add component > AR environment prob manager
- (extra) Direction Light > add component > HDRLightEstimation.cs (put ar camera there)
- then, at ar camera manager, light estimation : everything
- (extra) ar session origin > add component > PlaceOnPlane.cs (place holderPrefab there, above raycast manager there)
in short:
- AR Session
- AR session origin (ar plane mgr < place prefab; ar raycast mgr; ar env prob mgr)
- ar camera
- light (hdrLightEmission)
extra interactive
- package add: XR interactive toolkit (no for new input, go ahead for update)
- root of interactive prefab root GameObject: - add
- AR selection(mode:single/mult)/Translation/Rotation/Scale interactable component
- (selection > put obj for selection visualizer)
- [opt: use AR Select interactable – Single]
- collider
- base quad obj with new material (unlit/transparent > with texture)
- Extra 2:
- AR camera: > add AR gesture mgr
- AR session: > add XR interaction mgr
- AR session: > add AR placement interactable (put to place prefab there, select mode: single/multi)
- [opt: use AR Placement interactable – Single]
AR Foundation Setup - markerless v2
- build setting: switch to target platform
- Package Manager from Unity registry : install (AR foundation) + (ARCore XR) + (XR interactive toolkit)
- note: if xr interactive pop up, choose (no for new input, go ahead for xr update)
- build setting > Player setting - other settings:
- OpenGL before vulkan
- min api : android api level 26 (store 30)
- scripting backend: ILL2CPP
- uncheck armv7 and check arm64
- input: both (need to restart Unity)
- xr plug-in, check ARCore
- create XR > AR session + AR session origin
- ar session origin > add: ar plane manager
- outliner > create XR > AR Default Plane, put it prefab
- drag that plane prefab into AR Plane Manager (plane prefab)
- direction mode: horizontal
- drag that plane prefab into AR Plane Manager (plane prefab)
- ar session origin > add: ar raycast manager
- ar session origin > add: AR environment prob manager
- (opt) HDRLightEstimation.cs into Directional Light, (put ar camera there); then, at AR camera manager, light estimation : everything
- AR camera: > add AR gesture mgr
- AR session: > add XR interaction mgr
- AR session: > add AR placement interactable [opt: use AR Placement interactable – Single] (put to place prefab there, select mode: single/multi)
- create GameObject Prefab
- root GameObject > - add: collider (if its children no collider)
- root GameObject > - add : AR selection [opt: ARSelectionInteractableAuto.cs]; (selection > put obj for selection visualizer)
- (opt) quad obj prefab with new material (unlit/transparent > with texture)
- root GameObject > - add : Translation [opt: ARTranslationInteractableAnchor.cs]
- root GameObject > - add : Rotation/Scale interactable component
AR GPS
- import AR GSP package, right click add > AR GPS > Create basic scene structure
UI Setup
- image with moving sprite
- ctrl+6: animation panel, select the image, and create, and drag image seq into animation
- make the image not blocking user click, uncheck Image > Raycast Target
Hardware Debug
- add package: android logcat
- window > analysis > android logcat