Skip to content

Web: AR point cloud on the frame, and displayPointCloud - #472

Merged
doranteseduardo merged 2 commits into
developfrom
fix/web-ar-tracker
Nov 26, 2026
Merged

doranteseduardo merged 2 commits into
developfrom
fix/web-ar-tracker

Conversation

@doranteseduardo

@doranteseduardo doranteseduardo commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

The web AR frame always carried an empty point cloud, and displayPointCloud had no web path. This puts the tracker's feature points on every web AR frame and draws them the way VROARScene does natively. Web only; iOS and Android are unchanged.

What changed

Point cloud on the frame (VROARWeb)

  • VROARSessionWeb::setPointCloud(points, identifiers) stores the latest cloud; every frame built afterwards carries it, so VROARFrame::getPointCloud() returns it on the web as it does on iOS and Android.
  • New export viroARSetPointCloud(xyz, ids): a flat x,y,z array in Y-up world space plus ids. The 4th component (ARCore's confidence) is 1, since the web tracker has none.

Drawing it (VROSceneWeb)

  • New export viroARDisplayPointCloud(display, textureHandle, sx, sy, sz, maxPoints).
  • VROSceneWeb::setPointCloudDisplay builds a VROFixedParticleEmitter on a node with the same surface VROARScene uses (1 x 1 quad, additive blend, no bloom), and the AR draw loop feeds it each frame's points. The node follows the scene root when the bridge swaps it.
  • textureHandle < 0 keeps the default dot; otherwise it uses the given texture, which is how displayPointCloud.imageSource arrives.

Default point texture (VROImageUtil)

initPointCloudTexture() was empty on WASM. It now draws a 32 x 32 white dot with a soft edge, which the additive blend turns into a glow like the image native ships.

Related

Testing

  • wasm/build_web.sh builds clean.
  • viro-web-renderer's package test checks the new exports against the declared bindings; its session tests cover the points reaching arSetPointCloud.

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.

3 participants