Skip to main content
Inspiring
October 26, 2014

JOVR 0.4.3.0: Java/Maven bindings for 0.4.3

I've updated my Java bindings for SDK 0.4.3. The source code can be found on Github here. Example code can be found here.

Developers using Maven (or a Maven compatible tool like Gradle) can declare a dependency on the following artifact:


<dependency>
<groupId>org.saintandreas</groupId>
<artifactId>jovr</artifactId>
<version>0.4.3.0</version>
</dependency>


Known issues

  • Linux rendering seems a bit unstable. It's currently listed as experimental and only tested in nVidia cards.

  • Only light testing has been done.

    36 replies

    Up and Coming
    November 18, 2014
    So I've finally got my windows development box running, and I have moved my test scene over to that. So I no longer need custom JOVR OSX build, and can depend on maven for dependencies. So things run the same when using 0.4.2 but with 0.4.3 I get an exception now (on mac it just didnt render anything).

    code is here:

    https://github.com/WhiteHexagon/example-jovr-jogl-rift

    step 7 - window
    Found Rift Monitor
    got: GL4bc
    reshape loc 0,0 size 1920x1080
    Exception in thread "main-Display-.windows_tiny-1-EDT-1" javax.media.opengl.GLException: Caught Error: Invalid memory access on thread main-Display-.windows_tiny-1-EDT-1
    at javax.media.opengl.GLException.newGLException(GLException.java:75)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:675)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowRepaintOp(GLAutoDrawableBase.java:213)
    at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:119)
    at com.jogamp.newt.opengl.GLWindow$2.windowRepaint(GLWindow.java:136)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3692)
    at jogamp.newt.WindowImpl.consumeEvent(WindowImpl.java:2665)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:664)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:691)
    at jogamp.newt.DisplayImpl.dispatchMessages(DisplayImpl.java:727)
    at jogamp.newt.DisplayImpl$7.run(DisplayImpl.java:656)
    at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:343)
    Caused by: java.lang.Error: Invalid memory access
    at com.sun.jna.Native.invokeVoid(Native Method)
    at com.sun.jna.Function.invoke(Function.java:367)
    at com.sun.jna.Function.invoke(Function.java:315)
    at com.sun.jna.Library$Handler.invoke(Library.java:212)
    at com.sun.proxy.$Proxy0.ovrHmd_EndFrame(Unknown Source)
    at com.oculusvr.capi.Hmd.endFrame(Hmd.java:179)
    at com.sunshineapps.riftexample.RiftClient0430$DK2EventListener.display(RiftClient0430.java:196)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:690)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:672)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:441)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
    ... 12 more
    step 8 - loop
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    jhericoAuthor
    Inspiring
    November 19, 2014
    "whitehexagon" wrote:
    So things run the same when using 0.4.2 but with 0.4.3 I get an exception now (on mac it just didnt render anything).


    I tried looking into this. I discovered something odd... the JOGL system apparently triggers a display call when the window is resized. Something about this call to display int he context of a resize event seems to be invalidating the VAO that the Oculus SDK creates on the first call to endFrame(). I tried some workarounds, like having display() return without doing anything the first time it's called, but I was still getting crashes from time to time. I tried following the logic of the JOGL rendering loop, but honestly it started to give me a headache.

    I'm not sure how dependent JOGL is on this animator mechanism, you might have more luck with writing your own explicit loop than using the animator stuff.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    November 19, 2014
    "jherico" wrote:

    I tried looking into this. I discovered something odd... the JOGL system apparently triggers a display call when the window is resized. Something about this call to display int he context of a resize event seems to be invalidating the VAO that the Oculus SDK creates on the first call to endFrame(). I tried some workarounds, like having display() return without doing anything the first time it's called, but I was still getting crashes from time to time. I tried following the logic of the JOGL rendering loop, but honestly it started to give me a headache.

    I'm not sure how dependent JOGL is on this animator mechanism, you might have more luck with writing your own explicit loop than using the animator stuff.


    I have tried with my own Animator, and also with no animator at all, but that display call still seems to trigger (also tried skipping first call with no luck). I'm going to post over on the JOGL forum and see if anyone recognises the issue.
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    Up and Coming
    November 21, 2014
    I've fixed a few things now with my JOGL code, and got all my dependencies either from maven or included as source.
    ie. project should finally build and run standalone :)

    Sadly I still cant make any progress. I've added a flag (useDebugHMD) for running without a Rift, ie debug HMD and still see the same exception coming up from the endFrame(poses, eyeTextures) call.

    I've stepped through this with the eclipse debugger. The textures both look correctly populated (and was working fine before, but I did see an earlier post that mentioned this could generate the error).

    So only the poses has really changed, and the objects there also look correctly populated, using the same copy as per jocular example (although there is a FIXME in that code...) It passes that line fine once (as part of the JOGL reshape), but subsequent calls from the animator generate that exception.

    The strange thing is that the 0420 was running ok, so unless my memory management of poses is wrong, I dont see what else could be the issue here.

    Anyway I've made my example now easier to switch between the two 'test cases', just change the pom dependency back to 0420 and the other example will run.

    https://github.com/WhiteHexagon/example-jovr-jogl-rift
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    New Participant
    November 25, 2014
    I tried your code 0430 whitehexagon, Crash and burn. It boots up all the way, then java itself takes a dump.
    Up and Coming
    November 27, 2014
    "redexe" wrote:
    I tried your code 0430 whitehexagon, Crash and burn. It boots up all the way, then java itself takes a dump.


    thanks for trying. yes that's the issue I can't solve so far. The 0420 works (with the pom change), so I think my JOGL NEWT stuff is okay, but I'm currently trying to debug that to confirm. I think I'm trapped in a void between the two API's. Or this might just be a startup sequence/timing issue, since something must be shared between the SDK and JOGL.
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon