HomeGuidesAPI ReferenceChangelogDiscussions
Hire a ReactVision Expert 🛠️Launch Studio 🖥️Sponsor on GitHub ❤️Log In
Changelog
added

ViroReact 3.3.0: Android material emission and reflection, web point clouds and a 3D virtual camera

On Android, materials take emissionColor, emissionTexture and reflectiveTexture as they do on iOS, and a reflectiveTexture no longer crashes the app. On the web, AR surfaces are in metres from the first one and keep their ids through a tracking loss. The tracker's point cloud reaches onARPointCloudUpdate and displayPointCloud, and hit tests return feature points. The 3D navigators take an opt-in virtual camera, cameras take a field of view, materials take emission and reflection, and a browser without WebGL2 gets a message instead of a blank canvas. The web build needs @reactvision/viro-web-renderer 1.4.0. iOS behaves as in 3.2.3. @reactvision/react-viro-onnx 1.1.0 ships alongside, and runs the object detector on CoreML on iOS.

Android

  • emissionColor, emissionTexture and reflectiveTexture on a material work, as on iOS. The first two threw "Invalid color/texture property" when the materials were created, and the reflective cube map was loaded and then dropped. As on iOS and the web, an emissionTexture scales emissionColor, which is black by default, so it needs an emissionColor to show. See ViroMaterials.
  • A material with a reflectiveTexture no longer crashes the app with Unable to find "uri" key.

Web

Everything in this section is web platform support: it is new on the web and already worked on iOS and Android. See the Web Setup Guide.

  • AR surfaces. Surfaces are in metres from the first one, and keep their anchor ids through a tracking loss, so a ViroARPlane and the content on it stay put. On an iPhone, the first surfaces used to be tens of metres across and tens of metres away. See ViroARPlane.
  • Point clouds and feature points. onARPointCloudUpdate and displayPointCloud work on ViroARScene. Points arrive in native's shape ([x, y, z, confidence] plus identifiers) once the tracker's scale is in metres; the web tracker has no confidence, so it is always 1. While either prop is set, hit tests also return FeaturePoint results, and Editor scenes' tap-to-place falls back to one when a tap misses every plane, as the native host does. See ViroARScene.
  • Tracking. A frame the tracker still tracks but flags with a reason (excessive motion, too few features or too little light) reports TRACKING_LIMITED with that reason, as ARKit does, while content keeps drawing.
  • Scene cameras in live AR. Under a scene ViroCamera or ViroOrbitCamera, dragging and camera reads work, and the ray and position hit tests start from the drawn camera: the camera node's position with the device's rotation, as on native.
  • Navigators. virtualCamera works on Viro3DSceneNavigator and ViroSceneNavigator. It is opt-in: the mouse, two fingers or the keys move the point of view (walk, look around in place, orbit a centre, lookFrom, pose). It stands aside while the scene makes one of its own ViroCameras active. onWebRendererError on the web navigators is called when the renderer cannot start, and a message over the canvas says why (most often, no WebGL2). See Viro3DSceneNavigator.
  • Cameras and materials. fieldOfView works on ViroCamera, across the viewport's longer side, as on native. emissionColor, emissionTexture and reflectiveTexture work on materials. See ViroCamera.
  • Images, models and input. ViroAnimatedImage plays GIFs where ImageDecoder is missing or reads fewer frames than the file has. ViroSpinner's built-in images load in any bundler. A GLB loads as a GLB whatever type it is given. Dragging a node under a turned or scaled parent moves it along the parent's axes from the first frame. A scene's own timeToFuse applies.
  • Editor scenes on web. StudioSceneNavigator reports a renderer that could not start through onError and renderError, as it does a failed scene load. See StudioSceneNavigator.

Object detection (@reactvision/react-viro-onnx 1.1.0)

  • iOS runs the model on CoreML, on the CPU, GPU and Neural Engine, and falls back to the CPU when CoreML cannot take the model. Before, iOS ran on the CPU only. Detections are unchanged.
  • One detection core for iOS and Android. On Android it ships for arm64-v8a and x86_64. On the 32-bit ABIs (armeabi-v7a, x86) the provider does not register. See ViroObjectDetector.

Check when upgrading

  • Web: install @reactvision/viro-web-renderer 1.4.0. The peer range is now ^1.4.0. Copy its whole wasm/ and slam/ folders. With 1.3.0 the new features stay off and a one-time warning names what is missing.
  • Materials with an emissionTexture also need an emissionColor, on every platform: the texture scales it, and it is black by default. On Android, check materials that set emission or reflection, since they now show.
  • Web: TRACKING_LIMITED now arrives with a reason where renderer 1.3.0 reported TRACKING_NORMAL. Check code that waits for TRACKING_NORMAL before showing content.
  • Web: virtualCamera right-drag turns the view in place. Alt with right-drag orbits, as right-drag alone used to.
  • ONNX detector on Android: @reactvision/react-viro-onnx 1.1.0 does not register on 32-bit ABIs.

See Upgrading to 3.2.0 for the upgrade notes, and the GitHub releases for ViroReact 3.3.0 and viro-web-renderer 1.4.0.