Skip to content

v2.50.0

Choose a tag to compare

@doranteseduardo doranteseduardo released this 09 Dec 00:54
· 80 commits to main since this release

ReactVision 2.50.0 Release Notes

New Features

All features from ViroCore 2.50.0 are included, plus React Native specific bug fixes.


Cloud Anchors

Cross-platform AR anchor sharing between iOS and Android devices.

  • Cross-Platform: Share anchors between iOS and Android devices
  • Persistent: Anchors can be stored for 1-365 days
  • Accurate: Sub-centimeter accuracy in good conditions
  • Scalable: Supports multiple concurrent users
<ViroARSceneNavigator cloudAnchorProvider="arcore">
  {/* Use sceneNavigator.hostCloudAnchor() and resolveCloudAnchor() */}
</ViroARSceneNavigator>

API Highlights:

  • hostCloudAnchor(anchorId, ttlDays) - Upload anchor to Google's servers
  • resolveCloudAnchor(cloudAnchorId) - Retrieve anchor on another device
  • cancelCloudAnchorOperations() - Cancel pending operations

Geospatial API

Location-based AR with GPS coordinates using Google's ARCore Geospatial API.

  • Earth Tracking: Track device position using GPS and Visual Positioning System (VPS)
  • Three Anchor Types: WGS84 (absolute altitude), Terrain (relative to ground), and Rooftop (relative to buildings)
  • VPS Availability Check: Verify if enhanced positioning is available at a location
<ViroARSceneNavigator geospatialAnchorProvider="arcore">
  {/* Use createGeospatialAnchor(), createTerrainAnchor(), createRooftopAnchor() */}
</ViroARSceneNavigator>

API Highlights:

  • createGeospatialAnchor(lat, lng, altitude, quaternion) - WGS84 anchor
  • createTerrainAnchor(lat, lng, altitudeAboveTerrain, quaternion) - Ground-relative anchor
  • createRooftopAnchor(lat, lng, altitudeAboveRooftop, quaternion) - Building-relative anchor
  • getCameraGeospatialPose() - Get current location with accuracy metrics
  • checkVPSAvailability(lat, lng) - Check VPS support at location

Scene Semantics

ML-based scene understanding with 12 semantic labels.

  • 12 Semantic Labels: sky, building, tree, road, sidewalk, terrain, structure, object, vehicle, person, water, unlabeled
  • Real-time Processing: Per-frame label fractions
  • Use Cases: Outdoor detection, environment-aware content, safety warnings
// Enable via cloudAnchorProvider or geospatialAnchorProvider
// Use getSemanticLabelFractions() for environment detection

const { fractions } = await arSceneNavigator.getSemanticLabelFractions();
if (fractions.sky > 0.1) {
  console.log("User is outdoors!");
}

Depth Occlusion

Visual occlusion behind real-world objects for realistic AR blending.

  • Three Modes: Disabled, DepthBased, PeopleOnly
  • Realistic Blending: Virtual objects hidden behind real surfaces
  • People Segmentation: Option to only occlude behind detected people
<ViroARSceneNavigator occlusionMode="depthBased">
  {/* Virtual content properly occluded behind real surfaces */}
</ViroARSceneNavigator>

Occlusion Modes:

  • "disabled" - No occlusion (virtual objects always on top)
  • "depthBased" - Use depth data to occlude behind real surfaces
  • "peopleOnly" - Only occlude behind detected people

Extended glTF Support

Expanded glTF 2.0 support with 17 additional features for improved 3D model compatibility.

Core Geometry & Materials

  1. Non-indexed geometry support - Primitives without index buffers
  2. LINE_LOOP primitive type - Converted to line strip with closing segment
  3. TRIANGLE_FAN primitive type - Converted to individual triangles
  4. Mipmap filter modes - Proper separation of min/mip filtering
  5. Alpha masking (MASK mode) - With alphaCutoff support
  6. Emissive materials - emissiveFactor and emissiveTexture
  7. STEP animation interpolation - Discrete keyframe transitions
  8. Sparse accessor support - Override specific buffer values

Camera & Scene

  1. Perspective cameras - FOV, near/far planes, aspect ratio
  2. Orthographic cameras - xmag, ymag, clipping planes
  3. Default scene selection - Respects model.defaultScene

Lighting (KHR_lights_punctual)

  1. Directional lights - Color, intensity
  2. Point lights - Color, intensity, range/attenuation
  3. Spot lights - Color, intensity, range, inner/outer cone angles

Material Extensions

  1. KHR_materials_unlit - Constant/unlit lighting model
  2. Normal texture scale - Controls bump intensity
  3. Occlusion texture strength - Controls AO influence

Bug Fixes

Memory Leak Fix

  • Enhanced memory safety across 8 Java modules through Fabric architecture migration
  • Fixed null reference issues in prop application during React Native's pre-attachment phase
  • Improved stability during AR session transitions and low-end device scenarios
  • Migrated 30 methods to use Fabric's UIBlock pattern for safer memory management

Affected Modules:

  • ARSceneModule
  • ARSceneNavigatorModule
  • CameraModule
  • ControllerModule
  • NodeModule
  • SceneModule
  • SceneNavigatorModule
  • VRT3DSceneNavigatorModule

onClick iOS Fix

  • Fixed ViroText onClick event handling on iOS
  • Resolved issue where onClick prop was incorrectly passed to native code, interfering with event delegation
  • Fixes GitHub issue #272

AR Image Marker Fix

  • Improved ARImageMarker lifecycle management with proper weak reference patterns
  • Prevents retain cycles and memory leaks during image target tracking
  • Proper cleanup via removeARImageTarget() when updating targets

Setup

Expo Projects

{
  "expo": {
    "plugins": [
      [
        "@reactvision/react-viro",
        {
          "googleCloudApiKey": "YOUR_API_KEY",
          "cloudAnchorProvider": "arcore",
          "geospatialAnchorProvider": "arcore",
          "android": {
            "xRMode": ["AR"]
          }
        }
      ]
    ]
  }
}

Then rebuild:

npx expo prebuild --clean
npx expo run:ios
# or
npx expo run:android

Bare React Native Projects

iOS - Podfile:

use_frameworks! :linkage => :dynamic

pod 'ARCore/CloudAnchors', '~> 1.51.0'
pod 'ARCore/Geospatial', '~> 1.51.0'
pod 'ARCore/Semantics', '~> 1.51.0'

iOS - Info.plist:

<key>GARAPIKey</key>
<string>YOUR_GOOGLE_CLOUD_API_KEY</string>

Android - AndroidManifest.xml:

<meta-data
    android:name="com.google.android.ar.API_KEY"
    android:value="YOUR_GOOGLE_CLOUD_API_KEY" />

Requirements

  • iOS: iOS 12.0+, ARKit-capable device
  • Android: Android 7.0+ (API 24), ARCore-supported device
  • Google Cloud: Valid API key with ARCore API enabled
  • Depth Features: LiDAR (iOS) or ToF sensor/ARCore Depth API (Android)