Note that the content itself is never moved, rotated, or scaled. After the content is placed, you can adjust its rotation and scale using the on-screen sliders. To use this sample, first move the device around until a plane is detected, then tap on the plane. The ARSessionOrigin's scale feature is useful if you want to make your content "appear" at a position on a detected plane and to scale, for example, a building sized object to a table-top miniature. Complex scenes often can't be moved after creation (e.g., terrain), and scale can negatively affect other systems such as physics, particle effects, and AI navigation. It does this by moving, rotating, and scaling the ARSessionOrigin instead of the content.
#FLOATING FOUNDATION EXAMPLE HOW TO#
This sample shows how to adjust the apparent scale of content in an AR scene.
#FLOATING FOUNDATION EXAMPLE ANDROID#
When using HDRLightEstimation, the sample will automatically pick the supported camera facing direction for you, for example World on Android and User on iOS, so it does not matter which you facing direction select in the ARCameraManager.cs component. The virtual light direction is also updated, so that virtual content appears to be lit from the direction of the real light source. When available, a virtual arrow appears in front of the camera which indicates the estimated main light direction. On iOS, this is only available when face tracking is enabled and requires a device that supports face tracking (such as an iPhone X, XS or 11).
Most devices only support a subset of these 6, so some will be listed as "Unavailable." The relevant script is HDRLightEstimation.cs script. You should see values for "Ambient Intensity", "Ambient Color", "Main Light Direction", "Main Light Intensity Lumens", "Main Light Color", and "Spherical Harmonics". This sample attempts to read HDR lighting information. The relevant script is BasicLightEstimation.cs script. You should see values for "Ambient Intensity" and "Ambient Color" on screen. LightEstimation BasicLightEstimationĭemonstrates basic light estimation information from the camera frame. The relevant script is SupportChecker.cs. This simulates the behavior you might experience during scene switching.ĭemonstrates checking for AR support and logs the results to the screen. The device will attempt to relocalize and previously detected objects may shift around as tracking is reestablished.Ĭlears all detected trackables and effectively begins a new ARSession.Ĭompletely destroys the ARSession GameObject and re-instantiates it. While paused, the ARSession does not consume CPU resources. Pauses the ARSession, meaning device tracking and trackable detection (e.g., plane detection) is temporarily paused. This uses the ARRaycastManager to perform a raycast against the plane. When a plane is detected, you can tap on the detected plane to place a cube on it. There are buttons on screen that let you pause, resume, reset, and reload the ARSession. This is a good starting sample that enables point cloud visualization and plane detection. See the AR Foundation Documentation for usage instructions and more information. Open Unity, and load the project at the root of the arfoundation-samples repository. Instructions for installing AR Foundationĭownload the latest version of Unity 2020.3 or later. For this reason, we provide this feature as a separate package which must be explicitly included.
If your application binary contains certain face tracking related symbols, your app may fail validation. Why is ARKit Face Tracking a separate package?įor privacy reasons, use of ARKit's face tracking feature requires additional validation in order to publish your app on the App Store. For earlier versions, see the table above. The main branch is compatible with Unity 2020.3 and later. ARFoundation turns the AR data provided by ARSubsystems into Unity GameObjects and MonoBehavours. ARSubsystems defines an interface, and the platform-specific implementations are in the ARCore and ARKit packages. This set of samples relies on five Unity packages:ĪRFoundation is built on " subsystems" and depends on a separate package called ARSubsystems. Example projects that use AR Foundation 4.2 and demonstrate its functionality with sample assets and components.