Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of Mirrors Broken on Oculus Quest (Discussion: a feature request for a mirror component in A-Frame) #4629

Closed
PlumCantaloupe opened this issue Jun 25, 2020 · 8 comments

Comments

@PlumCantaloupe
Copy link

PlumCantaloupe commented Jun 25, 2020

This might be a an Oculus device issue, or maybe an issue with the XR renderer/camera implementation in three.js ( mrdoob/three.js#19666 ) as it works in Firefox Desktop with the Quest in Link mode but does not work in either the Oculus Browser or Firefox Reality in standalone mode. However, I figured this area is likely the best area to discuss it. I am not exactly sure when this stopped working, though I suspect it was the jump to the WebXR API, but mirrors appear to broken in the two ways.

  • This mirror only appears in one eye (seems to be right eye consistently). This just started happening on the most recent Oculus Browser update. Doesn't appear to happen in Firefox Reality.
  • When using another camera to render the mirror's texture (RenderTarget) the main camera breaks and will no longer reveal appropriate world matrices and will no longer allow elements to be parented to it (further information on this issue here: Attaching object to camera does not work in Oculus Quest #4626 ).

Hopefully someone more familiar with the underlying systems might see the trivial errors I have made, or perhaps some workarounds as I am using mirrors in my VR research :D

These are the warnings (no errors) I am seeing in the console on the Oculus Browser:
Capture_Cust

I have created two example scenarios to showcase:

Though I understand that the use of secondary cameras for special effects is more of a fringe case it could be indicative of a larger issue. Also, as important as embodiment is for connecting to avatars, and the use of virtual mirrors to create a greater sense of embodiment, I would love to see and help support a "reflector" being an included component in A-Frame if others agree.

@PlumCantaloupe PlumCantaloupe changed the title Use of Mirrors Broken on Oculus Quest (also, a feature request for a mirror component in A-Frame) Use of Mirrors Broken on Oculus Quest (Discussion: a feature request for a mirror component in A-Frame) Jun 25, 2020
@dmarcos
Copy link
Member

dmarcos commented Jun 27, 2020

A mirror component would be probably better as a 3rd party / community one. We can reconsider if there's more demand.

@PlumCantaloupe
Copy link
Author

PlumCantaloupe commented Jun 28, 2020

Okay, thank you. Will keep poking at this and see if I can gauge interest somehow.

Is it possible that this issue is browser / WebXR spec. related @Artyom17?

I created a pure three.js example and noted it here (appears to have similarly strange issues): mrdoob/three.js#19666 (comment)

Glitch example: https://glitch.com/~pure-threejs-mirrortest

@dmarcos
Copy link
Member

dmarcos commented Jun 28, 2020

I would have to look into it. Not an answer to your question but a possible alternative would be to have a copy of the avatar model in front of the user and apply headset and controllers pose to them. Simpler and also better performance than rendering the scene multiple times.

@PlumCantaloupe
Copy link
Author

Thanks for the “Mario64” suggestion @dmarcos :) I might have to do something like that if I am still stuck later in the summer.

I think my next attempt will be looking at the mirror code itself and comparing to how shadow-mapping cams render depth. Maybe there is something there that could help ...

@dmarcos
Copy link
Member

dmarcos commented Nov 5, 2020

I think there's nothing actionable on A-Frame side. If there's any fix to be done has to happen on the THREE side. Closing but we can reopen if necessary.

@PlumCantaloupe
Copy link
Author

PlumCantaloupe commented May 28, 2021

Just commenting here to connect all the dots that this has been resolved on the THREE end ( mrdoob/three.js#19759 ); but is still on issue on A-frame oddly ( #4806 (comment) ).

I will see tonight if I can build A-Frame with a non-super-three version of THREE to see if this will fix it to narrow down where this happening ...

@PlumCantaloupe
Copy link
Author

For any stragglers, finally found a workaround here: #4806 (comment)

@diarmidmackenzie
Copy link
Contributor

An implementation of mirrors for A-Frame is available here:
https://github.com/diarmidmackenzie/aframe-multi-camera

Specifically:
https://diarmidmackenzie.github.io/aframe-multi-camera/examples/mirror-example.html

Currently they work great on desktop, but they are heavily pixellated in VR (on Oculus Quest 2, at least), and I haven't yet understood why, but some ideas for further investigation.

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

No branches or pull requests

3 participants