Oculus Rift SDK-041 with JOVR and GL 2.1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Oculus Rift SDK-041 with JOVR and GL 2.1

BrickFarmer
So my goal is to create a simple demo for DK2 based on OpenGL 2.1 since that is what my current hardware supports.  I'm trying to do this with SDK based distortion.  I'm doing this from scratch on the JOGL side so that I can learn as I go :)

So I setup the HMD and sensors.  Then create a 1920x1080 NEWT window (dimensions pulled from HMD). That seems to be working.

So since I'm 2.1 bound, I'm thinking the next step is going to be to create 2 offscreen rendering buffers with "createOffscreenAutoDrawable"?.  Then render my scene once per eye.  Next I somehow need to retrieve a textureId from this offscreen target "getDelegatedDrawable"? and pass the textureIds down to the Oculus SDK.  I guess I also need to render the two textures into my NEWT window, left and right eye quads?  So a third 2D Drawable?

Or am I misunderstanding the new API?  Should I be starting with scene rendering directly into my NEWT window (2 drawables side by side?) and then somehow capture part of the buffers as textures?
Reply | Threaded
Open this post in threaded view
|

Re: Oculus Rift SDK-041 with JOVR and GL 2.1

BrickFarmer
Here is my limited progress so far:

https://developer.oculusvr.com/forums/viewtopic.php?f=20&t=13642

My NEWT window it is initially full of garbage.  Is there a way to request a NEWT window that is initially blank?

Here is how I'm creating my 2 offscreen buffers:

        GLOffscreenAutoDrawable leftEye = glDrawableFactory.createOffscreenAutoDrawable(null, caps, null, renderTargetEyeSize.w, renderTargetEyeSize.h);
        GLOffscreenAutoDrawable rightEye = glDrawableFactory.createOffscreenAutoDrawable(null, caps, null, renderTargetEyeSize.w, renderTargetEyeSize.h);

This is how I retrieve my 2 textureId for passing down to the SDK.  The two offscreen buffers seem to return the same textureID (1), am I doing something wrong here?

            final GLFBODrawable fboDrawable = (GLFBODrawable)drawable.getDelegatedDrawable();
            final TextureAttachment texAttach = fboDrawable.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
            int eyeTextureId = texAttach.getName();