mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.78k stars 35.38k forks source link

WebGLRenderTarget doesn't seem to work in WebVR #23234

Closed ZengRun closed 2 years ago

ZengRun commented 2 years ago

Describe the bug

I modified the crossfade example to support WebVR by simply adding an VRButton. But in WebVR, there is no crossfade when the scenes are switched, instead a black screen. I tried to follow the suggestion in issue 15614 by disabling and re-enabling VR when rendering the buffer scene,but it didn't work。

企业微信截图_303109a2-f6fa-46b3-aa2c-611cc61761e4

How can I fix this problem.

Screenshots CPT2201141627-1091x888

Platform:

Mugen87 commented 2 years ago

Please use the forum for help requests.

claytonrothschild commented 2 years ago

@ZengRun did you ever solve this?

your immediate problem is likely that you are rendering Orthographic Projection for the transition in WebXR and it doesn’t work easily. This is likely why you were referred to the forum, as your problem was approach rather than a bug.

But, even with proper architecture I am seeing weird behavior. For example, it works in WebXR emulator well but not in actual Oculus.

I need to demonstrate this issue by building a codepen. But perhaps you already have one I can work off of? Thanks