Repository navigation
Release 3.3.0 - #637
Merged
Merged
Release 3.3.0#637
Conversation
Viro3DObject on web chose the loader from the type prop, so a GLB handed over under type="OBJ" or "VRX" was parsed as that format: nothing was drawn and the load still reported success. A GLB's header now decides before the type hint. This is what a preview does when a local OBJ has no file yet and a GLB stands in for it.
The virtual camera's controls had only reset(). lookFrom(position, target) puts the camera at a point looking at another and keeps the orbit state in step, so a caller can show a scene from a chosen side.
A local model with no file was drawn as the Damaged Helmet, which reads as real content. The stand-in is now a 1 m checker box whose orange face, with an arrow pointing up, is the front (+Z). It is a 3 KB GLB written by scripts/make-harness-placeholder.mjs and built as a file of its own, since a framed page may fetch only from its own origin. The demo page keeps the helmet.
Inspect showed draw calls and triangles. It now also shows the frame rate and an estimate of the texture memory the renderer allocated, and for a selected model its triangles, embedded texture bytes and longest texture side against each platform's budget. The stand-in model is listed as "placeholder" and is not measured.
A capture page (?shot=1) has window.__previewShotView(view): the starting camera, a side of the scene's content (framed from the centre of its leaf nodes, far enough back to fit them), or a position and the point to look at. It returns the pose used, or null when the scene has no camera to move.
The page lists the local assets drawn as stand-ins and, where the host provides uploadAsset, takes the real file from a file picker or a drop on the page. A dropped file goes to the placeholder with its name, else the only one with its extension, else the viewer picks.
ViroARPlaneSelector draws its children only once a plane is selected, so a tap-to-place scene looked empty in the preview. While a selector shows a plane and has none selected, the page says to click the highlighted surface.
A stand-in keeps the scale written for the model it replaces, so a model authored in other units made the 1 m box a speck or a wall.
A scene that runs again after an update fetched every model again, and a sandboxed page keeps little or nothing in the browser's cache. The page now shares a download in flight and keeps finished ones in memory while the preview uses them, retries a download twice after a gateway error or a dropped connection, and shows a chip with how many models are loading and how many MB, over a bar that only shows activity because the total grows as files arrive.
Each upload ran the whole scene again, reloading every model. A local model's require() URL now carries its specifier, and Viro3DObject resolves it when it renders, so an update that only changes which file a model shows swaps that model in place. Viro3DObject also lists the models still loading in renderState.loading, for a screenshot to wait on.
An update that changes only assets other than models waits 1.5 s for more before running the scene again, so a burst of uploads runs it once instead of cutting each run off mid-load. While models have been loading for a second with nothing downloading, the chip says "Preparing N models".
The virtual camera's controls gain pose(), and the preview page puts the camera back with lookFrom after an update remounts the scene. Switching scenes still starts from the starting pose.
useViroLight registers each light per scene (viroLightEntries), so the inspector lists it under its node with colour, intensity, position and direction, and rings an omni or spot light while no node above it is turned or scaled. Selecting a glTF or GLB model lists the nodes inside it, read from the model file: names, triangles and material names. The renderer cannot address those, so a part has no ring.
The web renderer reports neither the start nor the end of a declarative animation, so useViroAnimation times each pass in JS: onStart and onFinish fire every pass, and a loop starts its next pass where the last ended, after the prop's delay again, as native does. Chains are resolved as VRTAnimationManager parses them: a registered array runs its members in parallel, an array inside it or behind a name runs them in sequence. The prop delay is now a wait before each pass, with a registered delay on top, as on native. A single animation looping to fixed values keeps the renderer's own loop.
The renderer reads back a node's world position but not its rotation or scale, so a node with onDrag keeps four empty probes under its parent, at its origin and a metre along each axis. Each drag move maps the world point into the parent's space through them (parentSpace), read again on every move, so a moving parent works too.
Code whose default export is the scene itself (a ViroARScene or ViroScene) failed with "must be rendered inside a Viro scene navigator". The render page now mounts code that mounts no navigator in navigatorType's: the AR navigator for "AR", the 3D one otherwise.
Viro3DSceneNavigator takes virtualCamera, as the AR navigator does: the same orbit controls drive a camera node of its own under the scene root, with the renderer's default 90-degree field across the longer side, and publish its view so dragging works in a 3D scene. It stands aside while the scene makes one of its own ViroCameras active (viroSceneCameras.ts) and takes over again when that camera goes.
The page hands 3D navigators (and VR ones, drawn as 3D) the virtual camera too, so a ViroScene can be looked around, inspected and shot from any side. The Grid button shows only while an AR scene, which draws the grid, is up.
The virtual camera takes a list of planes in place of its single floor, and the navigator updates its anchors when the list changes. Without an AR session, performARHitTestWithPoint now tests a ray from the virtual camera against those planes within their extent instead of returning nothing. Results carry native's type and transform beside the web fields. onCameraARHitTest runs the same test from the middle of the view every frame.
A picker beside Grid offers Empty (the floor plane alone), Empty room, Table, Living room, Kitchen, Office, Hallway and Patio. Each room is an entry in ROOMS: walls on three sides or an open floor, and furniture drawn as unlit boxes, whose marked tops are reported as horizontal planes. The choice is kept across updates; the AR navigator wrapper re-renders when its defaults change.
The prop maps to the renderer's setNodeSelectable, so taps and hit tests pass through the node and everything under it, loaded model content included. Needs a viro-web-renderer with setNodeSelectable.
The picker offers Empty, Living room and Office. Each room is a GLB served beside the harness with a planes list, drawn with depth and with ignoreEventHandling so taps reach the planes and the content inside furniture bounds. The box rooms are gone.
With a renderApi, the picker adds the scans it lists under "Your scans". A scan is drawn from its mesh and planes URLs with its origin at the camera, where its recording started, and its planes file gives the floor height. Rooms now carry their GLB and planes URLs instead of a file name.
Both branches solved several of the same problems on web; one version of each is kept: - Which ViroCamera is the point of view: viroSceneCameras (per node, with listeners the virtual camera needs). ViroOrbitCamera now registers too, so the virtual camera stands aside for it, and cameraView, dragging and the camera reads all read it. holdCustomCamera is gone. - A parent's space while dragging: the probe nodes, which follow animated and nested parents. The props-based parentSpace and multiplyQuats are gone. - Hit tests: viroHitTest, which also returns hits beyond a plane's extent as ExistingPlane and checks the extent on session hits. Results keep the web session's fields beside native's. All four hit tests and the camera reads work against the virtual camera's planes when there is no session. viroPlaneHitTest is gone and its tests moved over. - Animations: the chain planner, with each pass's steps recorded so a relative animation carries on from where the node is, including from inside an interrupted chain. A pass with no delay starts in the same frame. Loops fire onStart and onFinish every pass. - Viro3DSceneNavigator: scene navigation and the virtual camera; the default camera view is published only while the virtual camera is off.
# Conflicts: # components/Viro3DObject.web.tsx
# Conflicts: # components/AR/ViroARScene.web.tsx
Safari and iOS have no ImageDecoder, so a GIF showed its first frame only. viroGifDecoder.ts decodes GIF87a/89a itself (LZW, colour tables, transparency, offsets, interlacing, the four disposal methods, frame delays) and is used when ImageDecoder is missing or cannot play the file.
Native draws an AR scene from a ViroCamera's node with the device's rotation on top, and the web refused drags there. cameraView now returns that composed view in AR, with the device's intrinsics, so drags and camera reads under a scene camera work as on native.
emissionColor, emissionTexture and reflectiveTexture (six faces, built into a cube) are applied through the renderer's new channels; an older renderer warns once instead.
It got null and an 'Unresolved import' warning, where PNG, JPEG and WebP get the checker image.
…d off on cleanup A scene-level onFuse always waited the default 2 s, since only the callback was read. Cleanup switched off click and hover on the root and left pinch, rotate and fuse on.
Native takes the ray and position hit tests, and the camera hit test's cameraOrientation, from the drawn camera: a ViroCamera's node with the device's turn on top. The web took the session's pose. Without a scene camera the two are the same.
Only the diffuse texture is sRGB on native, so an sRGB emission map drew darker on the web than the same material on a phone.
Opened, each scene shown once per update, the device, surroundings and grid settings, the main buttons and their shortcuts, and the time open. Sent only where the input carries eventsUrl, never from the capture page; a scan's or recording's name stays out.
The note under the Surroundings picker was the only sign, and it is hidden once the settings panel closes. After a second of loading, the loading chip says the recording is being prepared, over the activity bar, and after 15 s that it can take a couple of minutes.
The page held one request open while a recording waited for a slot and was made, which can take minutes, longer than a proxy keeps a request open. The server now answers 202 while it is still being made, and the page waits a second and asks again. It asks for the track first, since the video is ready once the track is.
The page is always dark, but its panels used the browser's light scrollbars.
Web AR: point cloud props, FeaturePoint hits, Studio fallback to a feature point
# Conflicts: # CHANGELOG.md
Android: emissionColor, emissionTexture and reflectiveTexture on materials
Web: virtual camera, surroundings and parity fixes for the Viro Live preview page
Web: GIFs without ImageDecoder, spinner images, emission and reflection, drag and hit tests under a scene camera
A failed ViroWebRenderer.create() left a blank canvas and a console error. The 3D and VR navigators now show a message over the canvas, naming a missing WebGL2 when the renderer rejects with ViroWebGLUnavailableError and a generic one otherwise. The AR navigator shows it in place of its camera prompt and Start AR button, which could never succeed without a renderer. onWebRendererError on all three lets the host hear about it. The error is matched by name, so renderers before the typed error get the generic message rather than a missing import.
StudioSceneNavigator on the web now passes onWebRendererError to both navigators and handles it like a failed scene load: the error goes to onError and renderError, so a host's error UI and error reporting see it instead of an empty canvas.
Fix/web renderer start error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release 3.3.0. Android materials take
emissionColor,emissionTextureandreflectiveTextureas on iOS, and areflectiveTextureno longer crashes the app. The web gets AR surfaces in metres that keep their ids, the point cloud and FeaturePoint hits, an opt-in virtual camera on the 3D navigators, camera field of view, emission and reflective materials, GIFs without ImageDecoder, and a message when the renderer cannot start. iOS behaves as in 3.2.3.What's in it
onARPointCloudUpdate,displayPointCloud,FeaturePointhits and Studio's fallback to one,TRACKING_LIMITEDwith its reason (Web AR: point cloud props, FeaturePoint hits, Studio fallback to a feature point #634); dragging and hit tests under a sceneViroCamera(Web: GIFs without ImageDecoder, spinner images, emission and reflection, drag and hit tests under a scene camera #633).virtualCamera,fieldOfViewonViroCamera, GLB detected by its header (Web: virtual camera, surroundings and parity fixes for the Viro Live preview page #632);onWebRendererErrorand the start message (Fix/web renderer start error #635).@reactvision/viro-web-rendererpeer^1.4.0, changelog and release notes.Notes
@reactvision/viro-web-renderer1.4.0 first: the web components call API that 1.3.0 does not have, andtscinprepareneeds its types.Testing
tsc --noEmitclean and 1294 jest tests pass against the renderer at 1.4.0.