AR Environment Occlusion Integration

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
AR Environment Occlusion Integration
Complex
~3-5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    744
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1160
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    562

AR Environment Occlusion Integration

We integrate realistic environment occlusion: virtual objects are occluded by real surrounding objects. Place an AR sofa against a wall, walk behind it — the sofa is partially hidden by your silhouette. Without occlusion, AR objects always render on top, breaking the illusion immediately. Technically, this is one of the most demanding effects because real-time depth information of the real world is required. Our experience shows that proper occlusion increases user engagement by 30–40% (based on A/B tests in our projects, consistent with Apple ARKit documentation). To achieve high-quality occlusion, device-specific characteristics must be considered and depth threshold properly tuned.

How LiDAR occlusion works

On iPhone 12 Pro and newer, iPad Pro, we use ARWorldTrackingConfiguration.sceneReconstruction = .mesh — a dense mesh of the environment. The mesh writes to the depth buffer, and AR objects behind the mesh are occluded. Accuracy is 1–2 cm at distances up to 5 meters, real-time with no latency. For devices without LiDAR, we use ML depth: a neural network predicts the depth map from RGB. ARKit's ARDepthMap / ARCore Depth API provide accuracy of 5–15 cm, with edge artifacts and 1–3 frame latency. For production: if the audience primarily uses iPhone Pro / iPad Pro, we use LiDAR. For mass-market apps, we recommend ML depth with LiDAR acceleration where available.

RealityKit: enable occlusion with one line

On devices with LiDAR and modern iOS:

arView.environment.sceneUnderstanding.options = [
    .occlusion,        // real objects occlude AR
    .collision,        // AR objects collide with real geometry
    .physics,          // physics relative to real surfaces
    .receivesLighting  // AR objects are lit like real ones
]

Without LiDAR on the same API: ARView uses person segmentation (A12 chips and newer) — only the human silhouette occludes AR objects. Limited, but better than nothing.

Why soft occlusion matters

At LiDAR mesh edges, occlusion can appear pixelated due to finite depth resolution. Soft occlusion via bilateral blur smooths the transition. In Metal: a custom kernel with depth-aware blur (blur only within the depth threshold). This is noticeable only on close inspection, but for premium AR products, it's worth implementing. We guarantee quality even on complex surfaces.

ARCore Depth API (Android)

On devices with a ToF sensor (Samsung Galaxy S21 Ultra, LG V60) — hardware depth. On others — ML depth from ARCore Depth API (Raw Depth Image):

val frame = session.update()
if (session.isDepthModeSupported(Config.DepthMode.AUTOMATIC)) {
    val depthImage = frame.acquireDepthImage16Bits()
    // depth in mm, 16-bit unsigned short
    // ARCore recommends using via OpenGL texture
}

ARCore provides an OcclusionShader through their sample — an OpenGL fragment shader that discards fragments of AR objects deeper than real geometry.

Comparison of occlusion methods

Method Devices Accuracy Latency Complexity
LiDAR mesh iPhone 12 Pro+, iPad Pro 1–2 cm 0 frames 2–3 days
ML depth (ARKit/ARCore) All A12+ / Android with ARCore 5–15 cm 1–3 frames 1–2 weeks
Person segmentation A12+ (iPhone) contour 0 frames 3–5 days

Occlusion support on popular devices

Device LiDAR ML Depth Person Segmentation
iPhone 12 Pro Yes Yes Yes
iPhone 11 No Yes Yes
iPad Pro 2020 Yes Yes Yes
Samsung S21 Ultra No (ToF) Yes No
Pixel 4 No Yes No

We select the optimal method for your project, considering target audience and accuracy requirements.

Shadows from virtual objects on real surfaces

A bonus to occlusion: an AR sofa casts a shadow on the real floor. In RealityKit with sceneUnderstanding.receivesLighting, shadows are automatic. In a custom renderer: shadow map from the AR object projected onto real-world geometry from the LiDAR mesh. Without LiDAR, shadows are only on ARKit-detected planes (floor, table). The user sees a "flat" shadow that does not follow the real surface relief.

When should you use a custom shader instead of built-in API?

When soft occlusion or non-standard behavior (e.g., semi-transparent AR objects) is required, built-in APIs are insufficient. A custom Metal/GLSL shader gives full control over the depth buffer and blending. We implement such solutions with performance considerations for target devices.

Process

  1. Analysis: define target devices, accuracy requirements, and budget.
  2. Design: select the stack (LiDAR/ML) and design the rendering architecture.
  3. Implementation: API integration, custom shaders, testing on real scenes.
  4. Testing: A/B tests on different devices, checking for artifacts.
  5. Deployment: publish to App Store / Google Play, configure TestFlight.
Occlusion testing detailsWe test on a set of scenarios: different distances to objects, complex textures (carpet, grass), camera movement. We check for z-fighting and flickering at edges. For each device, we collect FPS and depth map latency metrics.

With over 10 years of experience and 40+ AR projects delivered, we ensure robust integration.

What's included in the work

  • Source code for occlusion integration (Swift / Kotlin / Dart).
  • Custom shaders (Metal / OpenGL ES) if needed.
  • Configured ARWorldTrackingConfiguration / Config.DepthMode.
  • Build and deployment documentation.
  • 30-day support after delivery.

Contact us to order occlusion integration for your AR application. Get a consultation for your project.

Checklist of common mistakes

  • .occlusion not enabled — objects are not occluded.
  • Missing LiDAR handling — crash on older devices.
  • Z-fighting due to too small offset in the shader.
  • Ignoring person segmentation — humans do not occlude AR objects.

Timelines and pricing

LiDAR occlusion via RealityKit API — 2–3 days integration. Person segmentation — 3–5 days. ARCore Depth occlusion on Android — 1–2 weeks (custom shader). Soft occlusion with custom Metal/GLSL shading — plus 1–2 weeks. Pricing is individual. We estimate the project after discussing details. Reach out for a consultation.

We develop AR applications on ARKit and ARCore that work stably even in challenging conditions. Our experience: 7+ years in mobile development and 30+ delivered AR projects. Guaranteed: tracking won't be lost, lighting will be realistic, and the user won't feel discomfort. Certified Apple and Google developers.

Why does tracking get lost and how to fix it?

ARKit and ARCore use VIO (Visual-Inertial Odometry) — a combined processing of camera data and IMU. Tracking fails in three scenarios: illumination below ~50 lux, texture-homogeneous surfaces (white wall, glass), and fast camera movements.

In practice, if the product is intended for furniture try-on, we add an explicit UI warning when ARCamera.TrackingState.limited(.insufficientFeatures). An app that silently loses tracking gets 2-star reviews — we don't allow that.

Plane detection is configured via ARWorldTrackingConfiguration.planeDetection = [.horizontal, .vertical]. Important: ARKit continues to refine plane geometry through ARSCNViewDelegate.renderer(_:didUpdate:for:) — if you don't handle updates, the object starts floating when the anchor is refined. Our team solves this at the architecture stage, not during testing.

AR Foundation: cross-platform with nuances

Unity AR Foundation is an abstraction layer over ARKit and ARCore. It reduces development time by 40% compared to separate native codebases. But some features (e.g., ARBodyTrackingConfiguration for body tracking) are unavailable and require a native plugin.

For React Native and Flutter, direct AR Foundation is missing. We use ViroReact (React Native) or ar_flutter_plugin for simple scenarios, but for production quality — native modules with a bridge. Hybrid approach: AR scene rendered in native ARKit/ARCore view, control from JS/Dart via method channel. Included in our standard delivery.

Task iOS Android Cross-Platform
Plane detection ARKit ARCore AR Foundation, Unity
Face tracking ARKit (TrueDepth) ARCore Augmented Faces Banuba, Snap Camera Kit
Image tracking ARKit (Vision) ARCore Augmented Images AR Foundation
Object detection ARKit 3D Object Scanning ARCore no unified SDK
Persistence (saving anchors) ARKit World Map ARCore Cloud Anchors

Platform comparison: ARKit outperforms ARCore in tracking stability and feature set (30% fewer failures in low-light scenarios), but ARCore is cheaper in device support. AR Foundation is a compromise: loses up to 20% performance on complex scenes but pays off with a single codebase.

Try-on: product fitting via AR

Fitting glasses, jewelry, cosmetics — a separate class of tasks. Here, face tracking is needed, not plane detection.

ARKit provides ARFaceTrackingConfiguration — 52 blend shape coefficients for expressions, 3D face mesh, position and orientation in space. Works only on devices with TrueDepth camera (iPhone with Face ID).

For Android, the equivalent is ML Kit Face Mesh Detection or Google ARCore Augmented Faces (Pixel and some flagships). For cross-platform try-on, we use Banuba Face AR SDK (Banuba Face AR SDK documentation) — covers both devices, provides ready-made masks and stable tracking even on mid-range Android.

Try-on quality critically depends on 3D product models. Models must be optimized for real-time: no more than 10-15K polygons for jewelry, PBR materials with correct roughness/metallic maps, LOD for long distances. Within our engagement, we provide ready-made optimization guides.

How to achieve realistic lighting in AR?

ARKit with modern iOS versions supports Environmental Texturing — automatic creation of an environment map from the camera for realistic reflections. Enabled via ARWorldTrackingConfiguration.environmentTexturing = .automatic. Without it, metallic and glass materials look plastic.

ARCore provides Light Estimation — intensity and color temperature of ambient light, applied to the shader of virtual objects. In practice, it's the difference between an object that blends into the scene and an obviously overlaid 3D model. We guarantee that the final image doesn't betray virtuality.

What's included

  • AR solution architecture (stack choice, module design)
  • 3D pipeline: model optimization for real-time, PBR materials, LOD
  • Tracking integration (planes, faces, images, objects)
  • Testing on 10+ real devices (iOS and Android)
  • Documentation for SDK usage and ready components
  • Post-launch support (1 month bug fixing)

Timeline and estimation

Simple AR scene with placing one 3D model on a plane — 1-2 weeks. Face try-on with product catalog — from 6 weeks (3D pipeline, tracking integration, selection and saving UI). Full AR shopping with cloud anchors and multiplayer — from 3 months. We'll estimate your project in 1 day — contact us to discuss your AR idea.