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

ViroReact 3.2.2: web catches up with native and a fix for Android VR release builds

Viro on the web catches up with native: pinch, rotate and fuse, drag in live AR, styled text, material effects, node transform reads, camera reads and AR hit tests, a light estimate from the camera, sound that mixes with video on iPhone, and recovery from a lost WebGL context. On Android, a minified VR build keeps the GVR classes its native library needs. Renderer binaries are rebuilt on virocore 3.2.2. The web build needs @reactvision/viro-web-renderer 1.2.0. 3.2.2 includes everything in 3.2.1.

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.

  • Gestures. onPinch, onRotate and onFuse work, from two fingers on a touch screen or the centre of the screen resting on a node. Drag works in live AR and in the 3D navigators, following the node every frame in its parent's space, with FixedToPlane in the Editor scene host. A press that a second finger cancels ends its drag. See ViroNode.
  • Node refs. getTransformAsync, getBoundingBoxAsync and getMorphTargets read a node, and setNativeProps sets its transform, opacity and visibility. See ViroNode.
  • Text. ViroText takes fontWeight, fontStyle, extrusionDepth and outerStroke. The web carries Roboto only, as Android's sans-serif, so another family draws in Roboto at the weight and style you ask for. See ViroText.
  • Materials. Alpha, bloom threshold, colour write mask and chroma key work. An alpha under 1 turns depth writing off unless the material sets it, as on native. See ViroMaterials.
  • AR. onAmbientLightUpdate reports a light estimate from the camera feed, which also scales the Editor scene host's light rig. onCameraTransformUpdate, getCameraOrientationAsync and getCameraPositionAsync read the camera. Hit tests return ViroARHitTestResult, through performARHitTestWithPoint, performARHitTestWithRay, performARHitTestWithWorldPoints and performARHitTestWithPosition. resetARSession(true, …) restarts tracking. See ViroARScene and ViroARSceneNavigator.
  • Navigation and animation. Viro3DSceneNavigator supports push, pop, popN, jump and replace, and AR scenes get the navigator as arSceneNavigator too. A declarative animation's onStart and onFinish fire, a relative animation starts from where the node is, and model clips honour delay. See Viro3DSceneNavigator.
  • Capabilities. The web host lists what it drops: cloud anchors report themselves unsupported, isARSupportedOnDevice answers from what the browser offers, and Editor scenes now report photo capture, video recording and occlusion as unsupported.
  • Editor scenes on web. Animations follow the native host's rules, ALERT functions show in a dialog over the canvas, onSceneChange fires once a navigation has loaded, a scene with no plane detection holds its assets until tracking settles, and tap-to-place waits for the AR session. See StudioSceneNavigator.
  • Sound mixes with video on iPhone. Sounds play from decoded buffers on one audio context; on iOS a sound beside a video with sound used to go quiet. Media the browser holds back plays at the first gesture, and the page asks for a playback audio session.
  • A lost WebGL context recovers. When the browser gives it back, the navigators create a new renderer and mount the scene again, and live AR shows its Start button again.

Android

  • A minified VR (GVR) build keeps the classes libgvr.so looks up by name. GVR's own rules keep only the classes marked @UsedByNative, while its native library also finds VrParamsProviderJni, GvrApi$PoseTracker, ExternalSurfaceManager and others by name, which R8 could remove. Viro's consumer rules now keep com.google.vr.**. Expo SDK 58 turns R8 on for release builds by default, so a VR app upgrading to it would minify GVR without opting in. AR-only apps were not affected. See Integrating with Expo.

Check when upgrading

  • Web: install @reactvision/viro-web-renderer 1.2.0. The peer range is now ^1.2.0. Copy its whole wasm/ folder, which now carries the Roboto faces styled text uses. On an older renderer at runtime, styled text, material effects, two-finger gestures and node reads fall back with a warning.
  • Android on Expo SDK 58: R8 is on for release builds by default. Build a minified release APK and open it on a device before you ship. With the ONNX detector, use @reactvision/react-viro-onnx 1.0.3, whose rules keep ONNX Runtime.

See Upgrading to 3.2.0 for the upgrade notes, and the GitHub release.