<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AR Foundation | Étienne Peillard</title><link>https://www.etiennepeillard.com/tag/ar-foundation/</link><atom:link href="https://www.etiennepeillard.com/tag/ar-foundation/index.xml" rel="self" type="application/rss+xml"/><description>AR Foundation</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Thu, 26 Feb 2026 00:00:00 +0000</lastBuildDate><image><url>https://www.etiennepeillard.com/media/sharing.png</url><title>AR Foundation</title><link>https://www.etiennepeillard.com/tag/ar-foundation/</link></image><item><title>Lab — Smartphone augmented reality</title><link>https://www.etiennepeillard.com/teaching/lab/ar-handheld/</link><pubDate>Thu, 26 Feb 2026 00:00:00 +0000</pubDate><guid>https://www.etiennepeillard.com/teaching/lab/ar-handheld/</guid><description>&lt;h2 id="objective">Objective&lt;/h2>
&lt;p>Create an augmented reality application capable of:&lt;/p>
&lt;ol>
&lt;li>detecting an image used as a marker,&lt;/li>
&lt;li>displaying a 3D object attached to this marker,&lt;/li>
&lt;li>detecting a plane in the environment,&lt;/li>
&lt;li>defining a play area,&lt;/li>
&lt;li>creating interactions between markers and the area.&lt;/li>
&lt;/ol>
&lt;h2 id="part-1--project-setup">Part 1 — Project setup&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>Create a Unity project.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Switch the platform to &lt;strong>Android&lt;/strong> in &lt;em>Build Settings&lt;/em>.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;blockquote>
&lt;p>To access logs on the phone, install &lt;strong>Android Logcat&lt;/strong> from the Package Manager.&lt;/p>
&lt;/blockquote>
&lt;ol start="3">
&lt;li>
&lt;p>Install &lt;strong>AR Foundation&lt;/strong>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Install &lt;strong>ARCore XR Plugin&lt;/strong> (Android) or &lt;strong>ARKit XR Plugin&lt;/strong> (iOS).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Open &lt;strong>Project Settings → XR Plug-in Management&lt;/strong> and enable:&lt;/p>
&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>&lt;strong>ARCore&lt;/strong> in the Android tab&lt;/li>
&lt;li>&lt;strong>ARKit&lt;/strong> in the iOS tab (if needed)&lt;/li>
&lt;/ul>
&lt;ol start="6">
&lt;li>In &lt;strong>Project Settings → Player → Android&lt;/strong>:&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>set &lt;strong>Minimum API Level: Android 10 / API 29&lt;/strong>&lt;/li>
&lt;li>in &lt;strong>Graphics APIs&lt;/strong>, disable &lt;strong>Vulkan&lt;/strong> and keep &lt;strong>OpenGLES3&lt;/strong> only&lt;/li>
&lt;/ul>
&lt;ol start="7">
&lt;li>Add to the scene:&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>&lt;strong>AR Session&lt;/strong>&lt;/li>
&lt;li>&lt;strong>XR Origin&lt;/strong> (with &lt;strong>AR Camera&lt;/strong>)&lt;/li>
&lt;/ul>
&lt;ol start="8">
&lt;li>Mobile rendering configuration&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>In the project, open: &lt;code>Assets/Settings/Mobile_Renderer&lt;/code>&lt;/li>
&lt;li>In the inspector: &lt;strong>Add Renderer Feature → AR Background Renderer Feature&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>Verify that the application launches on the phone and that the camera feed is visible.&lt;/p>
&lt;p>When launching the app on the phone for the first time, &lt;strong>allow camera access&lt;/strong> when requested by the system.&lt;/p>
&lt;h2 id="part-2--image-detection">Part 2 — Image detection&lt;/h2>
&lt;ol>
&lt;li>Create a new &lt;strong>Reference Image Library&lt;/strong> asset.&lt;/li>
&lt;li>Add a marker image.&lt;/li>
&lt;li>Add an &lt;strong>ARTrackedImageManager&lt;/strong> component to the XR Origin.&lt;/li>
&lt;li>Assign the image library.&lt;/li>
&lt;li>Create a prefab for the 3D object to display on the marker.&lt;/li>
&lt;li>Assign this prefab to the &lt;strong>ARTrackedImageManager&lt;/strong>.&lt;/li>
&lt;/ol>
&lt;blockquote>
&lt;p>You can use the markers provided for this lab. The &lt;strong>ImageLibrary&lt;/strong> asset is available &lt;a href="./Image%20Library%20small/ImageLibrary_small.unitypackage">here&lt;/a> and the markers are available &lt;a href="./Image%20Library%20small/markers_sheet.png">here&lt;/a>.&lt;/p>
&lt;/blockquote>
&lt;h2 id="part-3--plane-detection-selecting-a-plane--play-area">Part 3 — Plane detection (selecting a plane + play area)&lt;/h2>
&lt;h3 id="objective-1">Objective&lt;/h3>
&lt;ul>
&lt;li>detect horizontal/vertical planes using AR Foundation&lt;/li>
&lt;li>allow the user to &lt;strong>tap&lt;/strong> on a detected plane&lt;/li>
&lt;li>place a &lt;strong>play area&lt;/strong> (GameBoard) on this plane&lt;/li>
&lt;/ul>
&lt;h3 id="31-add-required-ar-components">3.1 Add required AR components&lt;/h3>
&lt;p>On the &lt;strong>XR Origin&lt;/strong> object:&lt;/p>
&lt;p>&lt;strong>ARPlaneManager&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Detects and maintains planes.&lt;/li>
&lt;li>Assign a &lt;strong>Plane Prefab&lt;/strong> to visualize planes.&lt;/li>
&lt;/ul>
&lt;h4 id="create-a-simple-plane-prefab">Create a simple Plane Prefab&lt;/h4>
&lt;ol>
&lt;li>&lt;strong>Create → Empty GameObject&lt;/strong>&lt;/li>
&lt;li>Name the object: &lt;code>ARPlanePrefab&lt;/code>&lt;/li>
&lt;li>Add the components:&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>&lt;strong>AR Plane&lt;/strong>&lt;/li>
&lt;li>&lt;strong>AR Plane Mesh Visualizer&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Mesh Renderer&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Mesh Filter&lt;/strong>&lt;/li>
&lt;/ul>
&lt;ol start="4">
&lt;li>Create a simple material (e.g. &lt;strong>Unlit / Color&lt;/strong> transparent).&lt;/li>
&lt;li>Assign this material to the &lt;strong>Mesh Renderer&lt;/strong>.&lt;/li>
&lt;li>Drag the object into the &lt;em>Project&lt;/em> folder to create a prefab.&lt;/li>
&lt;li>Assign this prefab in &lt;strong>ARPlaneManager → Plane Prefab&lt;/strong>.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>ARRaycastManager&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Used to cast a ray from the screen to detect planes.&lt;/li>
&lt;/ul>
&lt;p>Recommended setting:&lt;/p>
&lt;ul>
&lt;li>Detection Mode → &lt;strong>Horizontal&lt;/strong>&lt;/li>
&lt;/ul>
&lt;h3 id="32-create-a-play-area-prefab-gameboard">3.2 Create a play area prefab (GameBoard)&lt;/h3>
&lt;p>Create a simple prefab:&lt;/p>
&lt;ul>
&lt;li>a &lt;strong>Quad&lt;/strong> lying flat&lt;/li>
&lt;li>a semi-transparent material&lt;/li>
&lt;li>scale around &lt;strong>0.5 m&lt;/strong>&lt;/li>
&lt;li>optional: &lt;strong>BoxCollider&lt;/strong>&lt;/li>
&lt;/ul>
&lt;h3 id="33-implement-tap-to-place-new-input-system">3.3 Implement tap-to-place (New Input System)&lt;/h3>
&lt;p>In this lab we use the &lt;strong>New Input System&lt;/strong> (Unity Input System Package) to detect taps.&lt;/p>
&lt;h4 id="prerequisites">Prerequisites&lt;/h4>
&lt;ol>
&lt;li>Open &lt;strong>Project Settings → Player&lt;/strong>&lt;/li>
&lt;li>Set &lt;strong>Active Input Handling → Input System Package (New)&lt;/strong>&lt;/li>
&lt;/ol>
&lt;h4 id="principle">Principle&lt;/h4>
&lt;p>Create a script &lt;code>BoardPlacement.cs&lt;/code>. The script should:&lt;/p>
&lt;ol>
&lt;li>enable &lt;strong>EnhancedTouch&lt;/strong> (at startup)&lt;/li>
&lt;li>retrieve the first active touch&lt;/li>
&lt;li>filter the &lt;strong>Began&lt;/strong> phase&lt;/li>
&lt;li>perform an &lt;strong>ARRaycast&lt;/strong> toward planes (&lt;code>PlaneWithinPolygon&lt;/code>)&lt;/li>
&lt;li>create or move the &lt;code>GameBoard&lt;/code> at the hit pose&lt;/li>
&lt;/ol>
&lt;p>Useful functions / APIs:&lt;/p>
&lt;ul>
&lt;li>&lt;code>EnhancedTouchSupport.Enable()&lt;/code> / &lt;code>Disable()&lt;/code>&lt;/li>
&lt;li>&lt;code>Touch.activeTouches&lt;/code>&lt;/li>
&lt;li>&lt;code>touch.phase&lt;/code> (New Input System)&lt;/li>
&lt;li>&lt;code>touch.screenPosition&lt;/code>&lt;/li>
&lt;li>&lt;code>ARRaycastManager.Raycast(...)&lt;/code>&lt;/li>
&lt;li>&lt;code>TrackableType.PlaneWithinPolygon&lt;/code>&lt;/li>
&lt;li>&lt;code>Pose&lt;/code>&lt;/li>
&lt;li>&lt;code>Instantiate(...)&lt;/code>&lt;/li>
&lt;li>&lt;code>transform.SetPositionAndRotation(...)&lt;/code>&lt;/li>
&lt;/ul>
&lt;h3 id="checkpoint">Checkpoint&lt;/h3>
&lt;p>You should be able to:&lt;/p>
&lt;ul>
&lt;li>see detected planes&lt;/li>
&lt;li>tap a plane&lt;/li>
&lt;li>place the play area&lt;/li>
&lt;/ul>
&lt;h2 id="part-4--interactions">Part 4 — Interactions&lt;/h2>
&lt;h3 id="41-basic-interaction">4.1 Basic interaction&lt;/h3>
&lt;p>Implement an interaction between:&lt;/p>
&lt;ul>
&lt;li>detected markers&lt;/li>
&lt;li>the play area&lt;/li>
&lt;/ul>
&lt;p>Possible examples:&lt;/p>
&lt;ul>
&lt;li>an object appears when the marker enters the area&lt;/li>
&lt;li>the marker moves an object within the area&lt;/li>
&lt;li>the marker orientation modifies a parameter&lt;/li>
&lt;/ul>
&lt;p>This section is intentionally open.&lt;/p>
&lt;h3 id="42-resources-for-going-further">4.2 Resources for going further&lt;/h3>
&lt;p>The &lt;strong>AR Foundation&lt;/strong> package provides several useful features to enrich your project.&lt;/p>
&lt;p>&lt;strong>Image tracking&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>ARTrackedImageManager&lt;/code>&lt;/li>
&lt;li>events: &lt;code>trackedImagesChanged&lt;/code>&lt;/li>
&lt;li>access to marker position&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Plane detection&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>ARPlaneManager&lt;/code>&lt;/li>
&lt;li>access to detected planes&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>AR Raycast&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>ARRaycastManager.Raycast()&lt;/code>&lt;/li>
&lt;li>allows interaction with the real environment&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>AR Anchors&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>ARAnchorManager&lt;/code>&lt;/li>
&lt;li>allows objects to remain fixed in space&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Light estimation&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>ARCameraManager&lt;/code>&lt;/li>
&lt;li>adapts virtual lighting to the real scene&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Face / body tracking&lt;/strong> (depending on device)&lt;/p>
&lt;ul>
&lt;li>Face Tracking&lt;/li>
&lt;li>Body Tracking&lt;/li>
&lt;/ul>
&lt;p>Official documentation:&lt;/p>
&lt;p>&lt;a href="https://docs.unity3d.com/Packages/com.unity.xr.arfoundation" target="_blank" rel="noopener">https://docs.unity3d.com/Packages/com.unity.xr.arfoundation&lt;/a>&lt;/p>
&lt;h2 id="part-5--scenario-design">Part 5 — Scenario design&lt;/h2>
&lt;p>You now have all the technical elements needed to create a complete AR experience.&lt;/p>
&lt;p>Invent a small application or mini-game using:&lt;/p>
&lt;ul>
&lt;li>one or several markers&lt;/li>
&lt;li>a zone&lt;/li>
&lt;li>at least one interaction.&lt;/li>
&lt;/ul>
&lt;h2 id="possible-extensions">Possible extensions&lt;/h2>
&lt;ul>
&lt;li>multiple markers&lt;/li>
&lt;li>interactions between markers&lt;/li>
&lt;li>visual effects&lt;/li>
&lt;li>AR user interface&lt;/li>
&lt;/ul>
&lt;h2 id="deliverables">Deliverables&lt;/h2>
&lt;ol>
&lt;li>Report (PDF) including:&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>description of the application&lt;/li>
&lt;li>screenshots&lt;/li>
&lt;li>technical explanations&lt;/li>
&lt;li>Git link to the Unity project&lt;/li>
&lt;/ul>
&lt;h2 id="grading">Grading&lt;/h2>
&lt;ul>
&lt;li>Project setup — &lt;strong>2 pts&lt;/strong>&lt;/li>
&lt;li>Image tracking — &lt;strong>2 pts&lt;/strong>&lt;/li>
&lt;li>Plane detection and placement — &lt;strong>4 pts&lt;/strong>&lt;/li>
&lt;li>Interactions — &lt;strong>4 pts&lt;/strong>&lt;/li>
&lt;li>Scenario design — &lt;strong>5 pts&lt;/strong>&lt;/li>
&lt;li>Technical quality — &lt;strong>2 pts&lt;/strong>&lt;/li>
&lt;li>Submission — &lt;strong>1 pt&lt;/strong>&lt;/li>
&lt;/ul></description></item></channel></rss>