Skip to content

Web: camera field of view, no reticle, and emission and reflective material channels - #470

Merged
doranteseduardo merged 3 commits into
developfrom
fix/web-fixes
Nov 26, 2026
Merged

doranteseduardo merged 3 commits into
developfrom
fix/web-fixes

Conversation

@PetkoKuzmanov

Copy link
Copy Markdown
Contributor

Summary

Three additions to the web build's wasm bindings, used by viro's web components and the Viro Live preview page.

  • viroSetCameraFieldOfView(node, degrees) sets a camera node's field of view across the viewport's longer side, as ViroCamera's fieldOfView does on native. 0 returns to the renderer's default.
  • No reticle on web. The web input presenter drew a fixed-pointer VR reticle: a dot at the centre of every scene, and a ring over clickable nodes. The web points with a mouse or a finger, so it now draws none. The shared presenter already handles a missing reticle.
  • Emission and reflection on materials:
    • viroSetMaterialTexture takes channel 6 (emission) and channel 7 (reflective, a cube texture).
    • viroSetMaterialEmissionColor sets the emission colour.
    • A texture whose type does not fit its channel is refused, because VROMaterialVisual::setTexture would abort the module.
    • A material merged onto a model carries all three, as on iOS.

Files

  • wasm/src/cpp/VROSceneWeb.cpp
  • wasm/src/cpp/VROInputPresenterWasm.h

Notes

  • viro-web-renderer exposes these in its own PR (fix/web-fixes). Its released viro-web.wasm needs a rebuild from this branch.
  • viro calls the new bindings only when they exist, so an older wasm keeps working without these features.

viroSetCameraFieldOfView(node, degrees) sets the camera's field of view
across the viewport's longer side, as ViroCamera's fieldOfView does on
native; 0 returns to the renderer's default.
The web input presenter made a fixed-pointer VR reticle, which drew a dot at the centre of every scene (a ring over a clickable node). The web points with a mouse or a finger, so it now has none; the shared presenter already handles a missing reticle.
viroSetMaterialTexture takes channel 6 (emission) and 7 (reflective, a cube texture), and viroSetMaterialEmissionColor sets the colour. A texture whose type does not fit its channel is refused, since VROMaterialVisual::setTexture would abort the module. A material merged onto a model carries the three too, as on iOS.
@doranteseduardo
doranteseduardo merged commit 597e649 into develop Nov 26, 2026
4 checks passed
@doranteseduardo doranteseduardo mentioned this pull request Nov 26, 2026
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