aframevr / aframevr/aframe

Rendering to a 2d canvas while XR mode enabled

Open
#4,937 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

I am trying to take a screenshot of the player's current camera view. I'm using the following code:

document.querySelector('a-scene').components.screenshot.capture('perspective')

It works in normal mode but when entering VR mode it doesn't work. It still saves the same image and ignores what VR camera looking at. Because as soon as it enters VR mode, it stops rendering the canvas, either freezes or turns black. Here's my scene:

<a-scene>
<a-sky src="puydesancy.jpg" rotation="0 -130 0"></a-sky>
<a-text font="kelsonsans" value="Puy de Sancy, France" width="6" position="-2.5 0.25 -1.5" rotation="0 15 0"></a-text>
</a-scene>

how to keep rendering inline canvas while on vr.

  • A-Frame Version: 1.2.0
  • Platform / Device: web

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided A-Frame scene and the components.screenshot.capture('perspective') entry point, first comparing normal mode with XR mode. Trace why the inline canvas freezes or turns black in VR, and consider the work complete when it continues rendering the current VR camera view while the screenshot is captured.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ar-vr-xr
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.