Commit 4c4c84e3 authored by Sylvain Buche's avatar Sylvain Buche
Browse files

Merge branch 'temp'

parents 70478c85 b665bf1f
Loading
Loading
Loading
Loading
+68 −1
Original line number Diff line number Diff line
@@ -24,4 +24,71 @@ This wrapper for the World Analysis relies on the ARFoundation (version 5.1.x) U

Image markers are supported on both iOS and Android platforms through ARKit and ARCore.

The name of the Trackable in the World Storage must correspond to the name of a file (jpg or png) placed in the Unity persistent data path of the application on the user device.
 No newline at end of file
The name of the Trackable in the World Storage must correspond to the name of a file (jpg or png) placed in the Unity persistent data path of the application on the user device. The variable keyvalueTags of the Trackable can also contain a parameter with the "url" key providing a link to download the image.

More information about ARFoundation Image Tracking can be found here: https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/manual/index.html

### Mesh Trackables ###

Mesh trackables are supported on iOS through ARKit.

ARKit can track meshes that are defined in the .arobject format. Such an object can be scanned with the sample application provided here: https://developer.apple.com/documentation/arkit/arkit_in_ios/content_anchors/scanning_and_detecting_3d_objects

Unity serializes .arobject into ARKitReferenceObjectEntry in the editor. ARKitReferenceObjectEntry cannot then be imported at runtime from a .arobjject file. Dynamic loading is not supported yet.

To support adding .arobject without recompiling the full application, we use a dedicated AssetBundle.
* Place you .arobject in the Assets Folder. For instance under Assets/ARObjects
* Associate the ARKitReferenceObjectEntry with the arfmeshes AssetBundle in the editor
* Build the AssetBundles. For that you can use the following menu: ARF--> Build AssetBundles iOS

Then you have two options:
* Placing the AssetBundle "arfmeshes" file (with this exact file name) in the Unity persistent data path of the application on the user device.
* The variable keyvalueTags of the Trackable can also contain a parameter with the "url" key providing a link to download the AssetBundle to the Unity persistent data path on the user device. Only one AssetBundle can be loaded.

The name of the Trackable in the World Storage must correspond to the name of the ARKitReferenceObjectEntry.

More information about ARFoundation Mesh Tracking can be found here: https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/manual/features/object-tracking.html

### Map Trackables ###

#### iOS: ARWorldMap ####

On iOS/ARKit Map Trackables are supported with  ARWorlMap feature. Only one Map Trackable per World Graph is supported.

In ARKit, an ARWorldMap includes ARKit's awareness of the physical space in which the user moves the device that can be serialized into a file to be reloaded later on the same or on another device: 
https://developer.apple.com/documentation/arkit/arworldmap

The .map file can be placed in the Unity persistent data path of the application on the user device with the following name: "ARkitWorlMap.map". Alternatively, the variable keyvalueTags of the Trackable can also contain a parameter with the "url" key providing a link to download the map file.

By default, the origin of the Map Trackable is the point (0, 0 ,0). If the Map includes an Anchor, you can use it as the origin by setting the name of the Trackable in the World Storage with the TrackableId of the ARAnchor stored in the map. https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/api/UnityEngine.XR.ARSubsystems.TrackableId.html

Samples for creating and serializing an ARWorldMap with ARFoundation can be found here:
https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/Runtime/ARWorldMapController.cs 

#### Android ARCore Cloud Anchors ####

On Android/ARcore Map Trackables are supported with Cloud Anchors.

Cloud Anchors are anchors that are hosted on the ARCore API cloud endpoint. This hosting enables users to share experiences in the same app: see https://developers.google.com/ar/develop/cloud-anchors

For using ARCore cloud anchors you need to:
* Add the the arcore unity extensions package as a dependency of the Unity project  https://github.com/google-ar/arcore-unity-extensions
* Add to the runtime asmdef of this package a reference to Google.XR.ARCoreExtensions.asmdef
* Add a new Script Define Symbol in the Unity project settings: "ETSIARF_ARCORE_EXTENSIONS"
* Then, follow the instructions detailed here https://developers.google.com/ar/develop/unity-arf/cloud-anchors/developer-guide and here  https://developers.google.com/ar/develop/authorization?platform=unity-arf to configure the project and your google cloud account

To use a Map Trackable that corresponds to a Google Cloud Anchor, the name of the Trackable in the World Storage must correspond to the name of Google UUID of the anchor.

### Geo Trackables ###

#### iOS: perspectives ####

On iOS, Geo Trackables are not yet supported with this package.

A first possibility for adding this support is to adapt the Google GeoSpatial code and then run your iOS application with the ARCore AR backend.

A second possibility is to add the support for ARKit GeoTracking: https://developer.apple.com/documentation/arkit/arkit_in_ios/content_anchors/tracking_geographic_locations_in_ar
This feature is not implemented yet due to the small number of places supported (see https://developer.apple.com/documentation/arkit/argeotrackingconfiguration)

#### Android: Google GeoSpatial ####
To come
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: 4ae147bac9ff8453284f59548528c2aa, type: 3}
  m_Name: ARCoreExtensionsConfig
  m_EditorClassIdentifier: 
  CloudAnchorMode: 1
  SemanticMode: 0
  GeospatialMode: 2
  StreetscapeGeometryMode: 0
+8 −0
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: cf9adc83079e8e1479b1a105856aab0e
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 11400000
  userData: 
  assetBundleName: 
  assetBundleVariant: 

Runtime/Materials.meta

0 → 100644
+8 −0
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: 573d01463f1ad468bafd74041040eeb1
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+83 −0
Original line number Diff line number Diff line
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
  serializedVersion: 8
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_Name: Blue
  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
  m_Parent: {fileID: 0}
  m_ModifiedSerializedProperties: 0
  m_ValidKeywords: []
  m_InvalidKeywords: []
  m_LightmapFlags: 4
  m_EnableInstancingVariants: 0
  m_DoubleSidedGI: 0
  m_CustomRenderQueue: -1
  stringTagMap: {}
  disabledShaderPasses: []
  m_LockedProperties: 
  m_SavedProperties:
    serializedVersion: 3
    m_TexEnvs:
    - _BumpMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailAlbedoMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailMask:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _DetailNormalMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _EmissionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MainTex:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _MetallicGlossMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _OcclusionMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    - _ParallaxMap:
        m_Texture: {fileID: 0}
        m_Scale: {x: 1, y: 1}
        m_Offset: {x: 0, y: 0}
    m_Ints: []
    m_Floats:
    - _BumpScale: 1
    - _Cutoff: 0.5
    - _DetailNormalMapScale: 1
    - _DstBlend: 0
    - _GlossMapScale: 1
    - _Glossiness: 0.5
    - _GlossyReflections: 1
    - _Metallic: 0
    - _Mode: 0
    - _OcclusionStrength: 1
    - _Parallax: 0.02
    - _SmoothnessTextureChannel: 0
    - _SpecularHighlights: 1
    - _SrcBlend: 1
    - _UVSec: 0
    - _ZWrite: 1
    m_Colors:
    - _Color: {r: 0, g: 0, b: 1, a: 1}
    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
  m_BuildTextureStacks: []
Loading