Skip to content

Styled text, material effects, pinch/rotate/fuse, node reads, context loss and an opaque canvas - #15

Merged
doranteseduardo merged 6 commits into
developfrom
feat/web-gestures
Nov 19, 2026
Merged

doranteseduardo merged 6 commits into
developfrom
feat/web-gestures

Conversation

@PetkoKuzmanov

Copy link
Copy Markdown
Contributor

Ships the virocore web build from ReactVision/virocore feat/web-gestures and exposes it in the scene API. Merge after that PR. The changes are listed under Unreleased in CHANGELOG.md, ready for 1.2.0.

Added

  • ViroSceneApi.setNodeSelectable: a node that is not selectable, and its subtree, is skipped by taps and hit tests.
  • Styled text:
    • ViroSceneApi.createStyledText takes a family list, weight, italic, extrusion depth and an outline or drop shadow.
    • ViroWebRenderer.loadTextFace fetches the Roboto face a weight or italic needs from beside the wasm, once per page.
    • copy-wasm copies the 11 faces into wasm/, so they reach hosts that copy that folder. viro-web.data is unchanged.
    • On an older binary, createStyledText draws plain text.
  • Material effects:
    • setMaterialAlpha, setMaterialBloomThreshold, setMaterialColorWriteMask (with the new ViroColorWriteMask bits) and setMaterialChromaKey.
    • On an older binary they do nothing, and supportsMaterialEffects is false.
  • Pinch, rotate and fuse:
    • Two touch pointers on the canvas become a pinch and a rotate on the node under their midpoint (onPinch and onRotate). They start on the first two-finger move, as the iOS and Android recognisers start them. The first finger's press is cancelled without a click.
    • onFuse covers the gaze at the screen's centre, and setNodeTimeToFuse sets its time.
  • Node reads:
    • getNodeWorldTransform and getNodeBoundingBox, in the same shapes as native's getTransformAsync and getBoundingBoxAsync.
    • supportsGestures is false on an older binary.
  • Context loss: isContextLost and addContextListener. After a restore, dispose the renderer and create a new one on the same canvas.

Fixed

  • The canvas is opaque, as a native view is. Empty space now shows the scene's clear colour instead of the page behind it.
  • dispose() stops the render loop. Before, every remount added another loop.
  • pointercancel no longer completes a click. It used to be sent as a release, which could click the pressed node.

Testing

  • The package test checks that every face the binary can ask for is in wasm/.
  • Checked through viro's web components in desktop Chrome and WebKit, Android emulator Chrome, and Chrome on an iPhone.

Wraps virocore's viroSetNodeSelectable: a node that is not selectable,
and its subtree, is skipped by taps and hit tests.
ViroSceneApi.createStyledText takes a family list, weight, italic,
extrusion and an outline or drop shadow, and draws plain text on a
binary without the binding. ViroWebRenderer.loadTextFace fetches the
face a weight or italic needs from beside the wasm, once per page.

copy-wasm copies the 11 faces into wasm/, so they ship and reach hosts
that copy that folder; viro-web.data is unchanged. The package test
checks every face the binary can ask for is there.
Two touch pointers on the canvas become a pinch and a rotate, started on the
first two-finger move as the iOS and Android recognisers start them. The
first finger's press is cancelled without a click, and pointercancel cancels
a press for any pointer id instead of releasing it.
Every remount used to add a render loop. After a restore the renderer is
spent: its owner disposes it and creates a new one on the same canvas.
Ships the virocore web build that creates the WebGL context without alpha.
@doranteseduardo
doranteseduardo merged commit ed87bdc into develop Nov 19, 2026
2 checks passed
@doranteseduardo doranteseduardo mentioned this pull request Nov 19, 2026
@PetkoKuzmanov
PetkoKuzmanov deleted the feat/web-gestures branch November 23, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants