April 22, 2021

All about AR File Formats

TLDR

iOS: USDZ under 10mb

Android & Web: GLB/GLTF under 10mb

Facebook and Instagram: GLB/GLTF under 4mb

Apple's USDZ file format

Placement

Place objects facing towards the camera (facing +z)

Base of the object should sit on the ground (y=0)

Pivot point should be at the origin (x,y,x = 0)

Physical Size

Sizing should be accurate in the 3D software

Animation

Provide an idle animation to add life to the object

Animations always loop

Animations and be a mix of skeletal and transform animation

Don't animate objects away from the origin

Keep a consistent bounding box throughout an animation

Prefer animations that make sense at a static location

Contact Shadow

Don't bake a contact shadow into the model

First animation frame is used for shadow creation

Appearance

iOS uses Physically Based Rendering (PBR) shader

  • Albedo (base color) 
  • Metallic (conductor or insulator)
  • Roughness (rough or shiny)
  • Normal (surface details)
  • Ambient occlusion (internal shadows)
  • Emissive (emits light)
Transparency

Use a separate material for transparent and non-transparent parts of the model

Provide and albedo texture with transparency in its alpha channel

Use transparent for see through areas, not for cutouts

Texture formats
  • Albedo (RGB/RGBA)
  • Metallic (Grayscale)
  • Roughness (Grayscale)
  • Normal (RBG)
  • Ambient Occlusion (Grayscale)
  • Emissive (RBG)

Any image format supoorted by iOS

Textures should be square powers of 2 (2048, 1024, 512...)

Size Limits

As a guide: 

  • 100k polygons or less
  • One set of 2048 by 2048 PBR textures
  • Ten seconds of animation or less

Always test on a real device for performance.

Optimising and Exporting

Freeze transforms and merge adjacent vertices

If possible, use a single texture for the entire model

Don't include textures you don't need

Spend you texture budget on areas that add most value and realism

Remember that pixels have a physical size in AR

Balance texture and quality against download size

Android's GLB/GLTF Format

File Format

glTF 2.0/glb, using these extensions:

  • KHR_materials_unlit
  • KHR_texture_transform
Animation
  • Looping skeletal animation
  • Looping rigid animation
  • Looping transform animation

The animation will be played on a loop. If the glTF file contains multiple animations, Scene Viewer plays only the first animation.

Recommended Limits

The overall performance of assets depends on setting constraints and making tradeoffs between vertices, materials, texture resolution, mesh per material, and other factors. Use the following guidelines to optimize your assets.

  • Number of triangles: The recommended limit is 100,000 triangles, but targeting the lowest number will maintain high performance in Scene Viewer. 30,000 to 50,000 is an ideal range.
  • Number of materials: The recommended limit is 10 materials, two of which can be alpha. Target the lowest number possible to keep the asset performing well.
  • Mesh per material: 1
  • Maximum texture resolution: 2048 × 2048
  • Bone (including non-weighted joints): 254 (hard limit)
  • Bone weights per vertex limit: 4 (hard limit)
  • UV: 1 UV per mesh (hard limit)
  • Model size: 10 MB (Bigger models may result in poor user experience.)
Shadow Support


Hard shadows are automatically rendered by Scene Viewer when placing an object, so we recommend against baking shadows into your model.

Texture Support
  • PNG format: PNG-24, indexed PNG-8.
    JPGs are preferred when there is no transparency because they reduce size.
  • Color space: sRGB
Materials

PBR

Scene
  • Axis: right-handed, with these properties:
  • +X is right
  • +Y is up
  • -Z points forward from the origin (in other words, the "front" of an asset should be facing +Z)
  • Scale: 1 unit = 1 meter (as defined by the glTF specification to ensure the model is placed in AR in true scale)

Facebook and Instagram File Formats

Spark AR doesn’t support the entire catalogue of custom features and deformers offered by popular 3D applications. Choosing the right 3D file format and knowing which features are supported in advance can improve your workflow and save frustration.

Supported file formats and features

Spark AR imports objects in the following 3D file formats:

  • FBX 2015 (binary and ASCII versions).
  • gITF 2 (binary and text versions).
  • COLLADA/DAE.
  • OBJ.
  • DAE.

Where possible, we recommend using FBX or glTF files. Only the following Spark AR compatible features will be imported:

  • Meshes.
  • Materials.
  • Textures.
  • Skeletal animations targeting the object’s position, rotation and scale.
  • 3D scenes.
  • Blendshapes (known as shape keys in Blender and blend shapes in Autodesk® Maya®).
Limitations and known issues

When working with blendshapes keep in mind that:

  • Blendshapes must share the same vertex IDs, and UV map as the source mesh or they either won’t work in Spark AR Studio or cause artefacts. Blendshapes don’t work on high-density meshes, keep the triangle count below 22k if you want to use them.
  • Animation keyframes on blendshapes won’t be imported.
  • If your 3D object has several blendshapes the export file may be too large. Only use blendshapes if necessary and for simple meshes.
  • Non-linear and custom deformers will be ignored. For example if you’re working in Autodesk® Maya®, don’t use nonlinear deformers as they won’t be imported to Spark AR Studio.

You should also note that:

  • KHR_texture_transform in glTF files aren’t supported.
  • Geometry compression (Draco) in glTF is not supported.
  • UDIMs or multiple UVs layouts per mesh aren’t supported.
  • Euler or bicubic interpolation for 3D keyframe animation isn’t supported.
  • If you import a skeleton with no skinning connected to it, Spark AR will consider it a null object.
  • Importing a skeleton in Spark AR Studio may result in extra transform nulls per bone.
  • Importing a 3D object with a triangle count above 22k generates duplicated material slots on the mesh.
File sizes

Maximum file size is 4mb.