Closed msub2 closed 11 months ago
After more tinkering I believe the rendering issue stems from somewhere in the code for the shaders, somewhere around https://github.com/x3dom/x3dom/blob/master/src/shader/ShaderComposed.js#L75 and other areas that check isVR == 1
. There are also the various VRmode == 2
codepaths in gfx_webgl.js, I'm just having a bit of difficulty nailing down exactly what's making it only render in the right eye still.
x3dom uses a Instanced-based single pass technique to render both eyes in one frame. I think the problem is that you set the wrong Viewport at https://github.com/msub2/x3dom/blob/webxr/src/Viewarea.js#L175
If you remove this line it should work
If I remove that, it looks closer to correct on a flatscreen view (i.e. with a WebXR API Emulator) but does not render correctly in-headset (my test scene contains a cube positioned directly ahead of the camera, but currently it renders distorted and in the far bottom-left of my view).
Flatscreen view
In-headset view (this also requires looking down and to the left in real life)
great progress !
Let me add my appreciation for this effort and, while I doubt being able to contribute to coding, if I can help in any other way, just let me know!
---- On Mon, 14 Nov 2022 15:14:35 -0600 Andreas Plesch @.***> wrote ---
great progress !
— Reply to this email directly, https://github.com/x3dom/x3dom/pull/1235#issuecomment-1314388866, or https://github.com/notifications/unsubscribe-auth/AWTX3ZXGFEP4OIJBDUSXZMLWIKTTXANCNFSM6AAAAAARSBMHPA. You are receiving this because you are subscribed to this thread.
Appreciate the encouragement! I'm always juggling several different projects at once but I'll try and continue to chip away at this as I can.
Would it make sense to try the 'local' reference space ?
session.requestReferenceSpace("local").then(function ( space )
I already have a version which works on my old Oculus Go, I will push it to a webxr branch as soon as possible.
@msub2 I have pushed my current state to a new webxr branch for testing:
@tsturm Fantastic, will take a look at it later today.
Rendering does indeed work on that branch, reset mine to it and fixed a small issue that was causing a DOMException. I do have a couple questions/thoughts:
Hello @tsturm @msub2 @andreasplesch, I tried to test this pull request and found issues which I have highlighted here https://github.com/x3dom/x3dom/issues/1245. Please let me know if I am missing something to resolve the issues.
Closing now that https://github.com/x3dom/x3dom/commit/18cf88c7d3fec2719846d055a4433018396a4b5a has been merged
Opening a draft PR while I work this out still. Right now I've gotten it to a point where it's successfully spinning up an XRSession and rendering to the headset, but for some reason it's only appearing in the right eye. It's not immediately clear why this is but I'll continue to work on it.