Build Log story

A Step-by-Step Guide to Building Personalised AR Experiences

Step aside, ChatGPT, there’s a new player in town, and it’s about to propel us light-years ahead, blurring the lines between the real and…

A school of fish swimming in clear blue ocean water, viewed from below.

Step aside, ChatGPT, there’s a new player in town, and it’s about to propel us light-years ahead, blurring the lines between the real and virtual. If you haven’t already heard about it, the “era of spatial computing is here”.

Yes, we’re talking about Augmented Reality (AR) and Apple’s latest and greatest innovation — the Vision Pro. As mind-bending as it seems, Apple Vision Pro takes us one step closer to elevating our human potential and experiences.

No more 2D videos, or flat apps on a screen. We can soon create 3D videos and have our apps hang out with us in our living rooms. We also won’t be limited by our screens anymore. Want to watch a movie stretching across your bedroom wall, you can with Vision Pro. We’re closer than ever to a profound new way of work, play and life.

But how is this relevant to you? Of course, creating 3D videos or watching movies on a larger-than-life screen sounds fabulous, but how will these affect you if you can’t afford to cough up $3,499 for a Vision Pro?

AR experiences don’t necessarily have to be costly. You can create completely personalised AR experiences using just your laptop and a freely available tool — Meta Spark Studio.

Here’s how!

THINGS YOU’LL NEED

First off, you’ll need a few assets to get started:

  1. An image* you want to superimpose on your face (e.g. a hat, sunglasses, etc.)
  2. A background image that will display behind you, and
  3. Images* of any foreground objects you want to appear in your scene

*Note: Images apart from the background image should have transparent backgrounds!

Next, you’ll need to download Meta Spark Studio. Now you’re ready to get started!

STEP 1: FACE TRACKING

Face tracking is really easy!

Begin by creating a Sharing Effect and add your image to the project. If you don’t have an image, you could search for a free downloadable image in the AR library.

Meta Spark Studio start screen with the Sharing Effect project option highlighted.

Then create a Face Tracker in your scene. This will automatically detect a face in your scene.

Meta Spark object panel with Face Tracker selected and the Insert button highlighted.

Thirdly, create a Plane object as a child object of your faceTracker and create a new material in your Assets window.

Meta Spark object panel with Plane selected and ready to insert.

Assign the image you uploaded as the texture of the material; then assign the material to your Plane object. You should now see your image appearing in your scene! In the below example, my image is called catHat, my material is called catHatMat, and my scene object is called catHatObj:

Inspector for the catHatObj plane with catHatMat assigned in the Materials section. Material inspector showing the catHat texture assigned to catHatMat.

You’ll most likely need to edit the basic transformations of the Plane object too — these include the scale (making it bigger or smaller), the position (along the x, y, and z, axes), and the rotation (to change which direction it’s facing.) There’s no single correct way to position these — feel free to try it out and figure out what looks best for your scene!

Transformations panel showing the cat-hat plane's position, scale and rotation values. AR preview with a pink cartoon cat hat aligned over the user's head.

STEP 2: BACKGROUND AND FOREGROUND DETAILS

To get a background to appear behind the user, we need to apply background segmentation to separate the user from the camera shot.

Meta Spark Camera inspector with Person segmentation assigned to a segmentation-mask texture.

We also add a canvas, on which we will place our person segmentation and the background (using rectangle objects).

Meta Spark object panel with Canvas selected and ready to insert. Meta Spark object panel with Rectangle selected and ready to insert as a 2D surface.

We need to do the usual process of adding the background image to our project, then assigning it to a material, and finally assigning the material to a rectangle object. In the example below, my background image is named bg while my material is named bgMat, and my scene object is named bgObj.

With a little customisation of the scene hierarchy, we now have a background appearing behind the user!

Material inspector showing the background texture bg assigned to bgMat. Inspector for the bgObj rectangle with bgMat assigned in the Materials section. AR preview combining a forest background, pink cat hat and pixel-art cats in the foreground.

Finally, adding foreground objects is easy — just follow the same steps again: add your images, assign them as textures to two new materials, and then assign the materials to two new rectangle objects in your scene! As always, you can customise the scale and position as needed.

STEP 3: ANIMATING ASSETS

You can also add animation to your scene by extracting the frames of an animated gif (or drawing them yourself!).

Here, we’ve taken a gif of a cat sprite, extracted the frames using a free website, and then added them to our project.

Once in your assets window, make sure you select ALL the image frames. Once selected, in the properties window, change the Type to Texture Sequence.

Assets panel with all 12 extracted cat animation frames selected. Texture Type menu with Texture Sequence highlighted for the selected animation frames.

Now we do the usual process, but with one extra step at the start: create a new Animation Sequence in your Asset window and assign your animated texture. Then assign your animation sequence to a new material, and assign your material to a rectangle object in your scene. Then we’re all done! Note in the Animation Sequence properties you can also change the FPS property depending on how fast you want your animation to run.

In our project below, the animated image is named cat3, the animation sequence is named cat3Anim, the material is named cat3Mat, and the scene object is named cat3Obj.

cat3Anim settings using the cat3 texture for a looping 12-frame animation at 8 FPS. Material inspector showing the cat3Anim animation sequence assigned to cat3Mat. Inspector for the cat3Obj rectangle with cat3Mat assigned in the Materials section.

STEP 4: PUTTING IT ALL TOGETHER

Finally, we’ve created a full scene!

AR scene tracking a pink cat-shaped hat above a moving user's head, with a forest background and pixel-art cats in front.

We’ve focused on using 2D images for this project, but you can also do the same with 3D objects — just download free .fbx 3D model files online and import them into Meta Spark.

Common Pitfalls

Don’t forget to uncheck “Use Depth Test” in the Advanced Render Options for any materials that you want to always appear in front of other objects. We do this with our 3 cats in the scene so that they always appear in front of the user.

Tips and Tricks

Once you get familiar with the basic process, adding new images and displaying them in your scene is easy! To recap, the basic process is:

  • Add an image asset
  • Create a new material and assign the image as a texture
  • Create an object in your scene and assign the material

And that’s all it takes to display the object! Afterwards, you can customise the object properties such as position, scale, etc. to perfect your scene.

WANT TO LEARN MORE?

Our team runs a Meta Spark Studio Bootcamp for all ages. If you or your organisation is interested in learning how to create immersive and engaging AR experiences, reach out to us at hello@tk.sg and we’ll be glad to design a comprehensive bootcamp that fits your specific needs!

SAMPLE PROJECTS YOU’LL MAKE

Animating Images demo: a phone finds an illustration on a laptop screen, then displays tracked AR content over it. Fruit Catcher AR game with fruit moving around a user's tracked face toward a basket below their chin.