jvm-graphics-labs / jogl-hello-vr

hello openvr jogl
MIT License
4 stars 4 forks source link

Problems running this demo #1

Closed i-make-robots closed 8 years ago

i-make-robots commented 8 years ago

Hi.

Apologies in advance if this is the wrong location to ask for help. I'm old and dumb.

Cloned jopenvr, jogl-hello-vr, and related libraries jgli, jglm, and java-unofficial-open-SDK. Massaged jogl-hello-vr to compile in Eclipse. Tweaked App::createAllShaders() to read from the correct directory and load the shaders.

When I run the program a window appears on my desktop flashing black/dark-grey very fast. HTC Vive HDR still shows default view ("this is real").

Any idea what am I doing wrong?

elect86 commented 8 years ago

Hi,

the sample has been yet to be finished, I wrote it almost completely without running it a single time

there must be a couple of bugs somewhere I guess

i-make-robots commented 8 years ago

Please: Any ETA on a working version? I need something that works as a base for my code.

elect86 commented 8 years ago

unfortunately not yet

elect86 commented 8 years ago

What do you need on the 11th? Is it fine also the OpenVR sample itself?

i-make-robots commented 8 years ago

I need it before the 11th because I need to make https://github.com/MarginallyClever/Robot-Overlord work with VR.

On Jun 2, 2016, at 11:53 PM, Giuseppe Barbieri notifications@github.com wrote:

What do you need on the 11th? Is it fine also the OpenVR sample itself?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

xinaesthete commented 8 years ago

Hi,

I got to the same point as @i-make-robots, will have a bit more of a tinker and post here if I make progress (although I should also be getting back to some other stuff...)

elect86 commented 8 years ago

If you can help, I'll add you

I didnt have a moment to work on that

i-make-robots commented 8 years ago

I would help but... http://img2.rnkr-static.com/list_img_v2/9660/549660/full/very-best-of-the-i-have-no-idea-what-i-m-doing-meme-u1.jpg

On Tue, Jun 14, 2016 at 11:07 AM, Giuseppe Barbieri < notifications@github.com> wrote:

If you can help, I'll add you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jovr/jogl-hello-vr/issues/1#issuecomment-225966400, or mute the thread https://github.com/notifications/unsubscribe/ABZYhrkFhtbnNHhnN6OCrKHwhmU6fFghks5qLu3ogaJpZM4Ir1eg .

Dan Royer, Owner, Marginally Clever Robots https://www.marginallyclever.com/ Ph: +1 (604) 259-9564 Mo: +1 (604) 916-2281

xinaesthete commented 8 years ago

Well, I'm making some progress I think. Not quite managed to actually get the thing showing the graphics I want, but close I think (actually, possibly close enough that it might even be easier to get it working with my own app than this sample at this point, but it'd be nice to make a contribution of use to others and my app isn't open source ATM unfortunately).

What I see now is the solid clear color which I've set to animate and different for each eye, so at least I can tell results of our drawing are being used. I can't actually remember which change it was that made it show that JOGL output on the HMD rather than the default stuff... (stupidly haven't even been using any source control for my changes so far, have probably made enough progress I should address that).

Commenting out the call to drawable.swapBuffers(); in the middle of display gets rid of the flickering on the window, although I note that you were following Valve's original C++ sample where they do the equivalent for performance.

I've added pose updating. Printing out hmdPose to console, the numbers look plausible. I think whatever bug I'm dealing with now is in the basic gl/scene code, nothing to do with OpenVR as such. As you can appreciate, I have less appetite for debugging someone else's GL code that I'm never going to use than I do for getting something working with OpenVR, hence it probably makes sense for me to try to integrate my own code as a next step.

I removed the distortion code, following stumbling on this issue https://github.com/ValveSoftware/openvr/issues/42 where it is mentioned distortion is dealt with by the compositor.

I'm not initializing the chaperone stuff or some other bits atm, don't think that's the cause of problems, but I suppose it's possible.

elect86 commented 8 years ago

Well, getting the clear color is undoubtedly the proof jovr is working :scream:

Thanks for all the hints you mentioned, they are extremely interesting. I am gonna try them as soon as I get some spare time to work on this.

Anyway I just added you, you may want to submit your changes with a small comment to help identifying which may be the code parts to get it working

xinaesthete commented 8 years ago

I've noticed that the chaperone box does appear when you move towards edges of space (although that's drawn by the compositor, not the java code... still nice to see something 3d).

xinaesthete commented 8 years ago

So, the call to glDrawArrays in Scene.render() was leading to GL_INVALID_OPERATION error generated. Array object is not active.

Oh yeah, forgot to mention; there was an issue where you set the stride to VertexDataLens.SIZE, which I'd fixed but then temporarily un-fixed. That stops the error but doesn't fix the rendering.

Most fun I ever had setting a stride parameter wrong was http://www.xinaesthetic.net/2010/09/ceci-nest-pas-une-molecule/

elect86 commented 8 years ago

I'll investigate, thanks for the contribution

xinaesthete commented 8 years ago

I was wrong again in my edited version of above comment; my change to the stride (5 * Float.Bytes rather than VertexDataLens.SIZE) doesn't get rid of the error, I had the draw call itself commented out when I reintroduced the stride change, hence no error.

xinaesthete commented 8 years ago

Well, FWIW, my other app is sort-of working now. For some reason HMD orientation is fine, translation doesn't seem to be happening and I've got some slightly odd frustum clipping going on, but it doesn't seem likely any of that's jOpenVR related - I'm probably just not accounting for all matrix mangling that's going on in my code.

Back in jogl-hello-vr, I also noticed that setupTextureMaps isn't being called yet. That wouldn't likely fix the Array object is not active error, but presumably might prove important shortly after.

p.s. there's a few points in the code where I put XXX: garbage comments; not a judgement on code quality, just flagging new objects being made which if the methods were called frequently would lead to excess garbage (actually, at a glance the only place where this really happens is the two new Texture_t objects in display, which is hardly close to being anything worth commenting on, so you really I'm just rambling about nothing much).

i-make-robots commented 8 years ago

This morning I updated jogl-hello-vr, jopenvr, jglm, jgli, and java-unofficial-opengl-SDK. App says it si running and a black window appears on my PC. headset still shows default view, floor, and playspace fence. What am I doing wrong?

elect86 commented 8 years ago

Use xinaesthete's commit as a starting base for your app

xinaesthete commented 8 years ago

I might get back to my fork and replace the GL bits with something that at least works, but can confirm that elsewhere I'm using very similar OpenVR code and it is working (well, for some reason still not tracking position properly, but that must be a bug in my code).

I've done a bit of messing with WorldWind in the past - various things I plan to do with that if I make time for it (or ideally raise funds). I might have a go at hacking an OpenVR layer onto that sometime (just thinking aloud).

elect86 commented 8 years ago

It sounds promising :)

elect86 commented 8 years ago

xinaesthete, I tried the changes you made, I only get a GL Error 1282 (coming somewhere from the valve code) and nothing get rendered on the screen, not even the clear color.

Anyway we updated jovr, may you try if your app still works with it?

elect86 commented 8 years ago

We made it, I commented out updateHMDMatrixPose() where compositor.WaitGetPoses.apply() essentially is... I'll upload a working sample asap

elect86 commented 8 years ago

I made it, it works :scream:

Thanks xinaesthete for your tips! :+1: