I’ve got rendering working, no distortion, but at least Windows isn’t killed
No commits, but here are some pointers:
I created two textures. I did it like this because it was important in the JOVR implementation:
private static final Texture2D eyeTextures[] = new Texture2D[]{new Texture2D(), new Texture2D()};
Then assigned them to the framebuffers:
Texture2D offTex = eyeTextures[eye];
Image texImage = new Image(Image.Format.RGBA8, cam.getWidth(), cam.getHeight(), null);
offTex.setImage(texImage);
And this is probably the most important part:
if( isInVR() && OpenVR.getVRCompositorInstance() != null ) {
int err1 = JOpenVRLibrary.VR_IVRCompositor_Submit(OpenVR.getVRCompositorInstance(), JOpenVRLibrary.Hmd_Eye.Hmd_Eye_Eye_Left,
JOpenVRLibrary.GraphicsAPIConvention.GraphicsAPIConvention_API_OpenGL, eyeTextures[0].getImage().getId(), null);
int err2 = JOpenVRLibrary.VR_IVRCompositor_Submit(OpenVR.getVRCompositorInstance(), JOpenVRLibrary.Hmd_Eye.Hmd_Eye_Eye_Right,
JOpenVRLibrary.GraphicsAPIConvention.GraphicsAPIConvention_API_OpenGL, eyeTextures[1].getImage().getId(), null);
if( err1 != 0 || err2 != 0 ) {
System.out.println("Compositor submit error: " + Integer.toString(err1) + ", " + Integer.toString(err2));
}
}
The common ID is the Image’s ID. The “Texture” object’s ID is internal to JME I believe.
With this I see the basic undistorted images. But I’ve merged manually from your branch so I might have missed something.
Edit: I realized it’s not important to initialize the Textures that way, since again, the Texture’s ID is not important in this context.
Edit2: OK, reread your posts and it seems I misunderstood some of the things. Just to confirm: I don’t see anything but white in the steamVR window.
Edit3: Changed RGB16 to RGBA8