Forum Discussion
bluenote
12 years agoExplorer
Official Java Bindings?
I'm wondering whether Oculus VR has plans to provide official cross-platform Java bindings in the SDK? Did they ever comment on this? And if so, will it be a JNI wrapper or even a native API?
The current situation for integrating the Rift on the JVM is imho rather cumbersome. Thanks to the great efforts of other users here, we currently have a few options for JNI based wrappers and we even have an approach which natively reads the HID and reimplements parts of the official SDK. This is not bad in order to get it to work, but since there are many more possibilities to deviate from the recommended implementation standard, it's more likely to end up with an unpleasant experience (for instance when you have a bug in your reimplementation of sensor fusion etc). Furthermore any SDK update will cause a significant amount of work. Currently I'm really looking forward to the upcoming 0.3 SDK, but probably moving from 0.2 to 0.3 will be pretty tough for the JVM world. So it would be really great to see any development towards a more convenient integration.
The current situation for integrating the Rift on the JVM is imho rather cumbersome. Thanks to the great efforts of other users here, we currently have a few options for JNI based wrappers and we even have an approach which natively reads the HID and reimplements parts of the official SDK. This is not bad in order to get it to work, but since there are many more possibilities to deviate from the recommended implementation standard, it's more likely to end up with an unpleasant experience (for instance when you have a bug in your reimplementation of sensor fusion etc). Furthermore any SDK update will cause a significant amount of work. Currently I'm really looking forward to the upcoming 0.3 SDK, but probably moving from 0.2 to 0.3 will be pretty tough for the JVM world. So it would be really great to see any development towards a more convenient integration.
10 Replies
- jhericoAdventurerIn addition the the Java library I've created here (to which I assume you're referring), I'm also working on a simple C interface to the SDK, designed to allow clients to link with the same SDK library but use a completely C interface.
This should make it significantly easier to create JNA/JNI bindings or bindings for other languages that will automatically track changes and improvements in the SDK. I plan to devote some more time to making it more feature complete once the 0.3 version of the SDK comes out (assuming OVR hasn't already done something similar). - rupyHonored GuestThe HID API drift accelerates after some time, Oculus should obviously maintain an official Java JNI wrapper! I use JMonkey driver now because it has quaternion, but it only has Win binary; JRift is bloated with euler workarounds, but now they added quaternion, no binaries for the update yet though!
It's a mess and there is not valid reason for it.
Edit: Now (Facebook) can we have an official Java driver? - jhericoAdventurer
"rupy" wrote:
Edit: Now (Facebook) can we have an official Java driver?
I wouldn't hold your breath. Might get a Javascript one though. - rupyHonored GuestThere already is one: http://www.benpurdy.com/oculus-bridge/
But it's never going to be fast enough... - bluenoteExplorer
"rupy" wrote:
But it's never going to be fast enough...
You are referring to Javascript?
I wouldn't be all too worried about performance in Java. My current project runs at about 2000+ fps (actually in Scala). It just depends on what you want to achieve. A photo realistic rendering engine is definitely more difficult on the JVM. But I see so many possibilities for exiting VR experiences which simply don't require photo realistic rendering. Sometimes you just want to put the user into a world, which is not supposed to look "real".
But I take Cyber's silence as indication that there really has not been any official statement on this yet, and the decision in still in the air?
So let's hope a tiny fraction of the funding will be spend on this :). - rupyHonored GuestThis will become more pressing the closer we get to DK2 release. I appreciate jherico's efforts with JNA, but I just want a simple JNI driver like the JMonkey or JRift ones, but with Quaternion orientation support for DK2 and native binaries for windows.
Unfortunately LWJGL is not running properly on either OSX or Linux, so we're stuck with Micro$oft. - jhericoAdventurer
"rupy" wrote:
This will become more pressing the closer we get to DK2 release. I appreciate jherico's efforts with JNA, but I just want a simple JNI driver like the JMonkey or JRift ones, but with Quaternion orientation support for DK2 and native binaries for windows.
I'm not clear on how exactly you would expect official Oculus JNI bindings to look substantially different from
these bindings. The math data wrappers now have converters to more complete math types including quaternions. This is the Oculus C API."rupy" wrote:
Unfortunately LWJGL is not running properly on either OSX or Linux, so we're stuck with Micro$oft.
LWJGL works fine for me on Linux. I haven't really tried OSX, but they do have binaries for that platform, so I don't know what you mean by 'not running properly' - rupyHonored Guest
"jherico" wrote:
I'm not clear on how exactly you would expect official Oculus JNI bindings to look substantially different from
these bindings. The math data wrappers now have converters to more complete math types including quaternions. This is the Oculus C API.
So this connects directly to the Oculus official binaries? What else do I need for this to work?
Make a tutorial: Download this and that, extract these ddls, .so etc. do this do that... so we can judge how much effort is involved."jherico" wrote:
LWJGL works fine for me on Linux. I haven't really tried OSX, but they do have binaries for that platform, so I don't know what you mean by 'not running properly'
Well this is really subjective but since there has been trouble for me, I suspect there will be trouble for others too:
- With linux (latest everything) on old X61s (First integrated Intel graphics with hardware 3D) I have flickering of display lists, it breaks the game completely.
- On OSX the viewport stuff is broken so only one eye renders if you use a scissor that is smaller than the viewport.
There are not enough users and/or developers of LWJGL to make these platforms AAA-title stable on all hardware on these operatives with legacy OpenGL.
So since a simple and competent Oculus driver is also hard to come by for these and FPS are ALOT slower on ANY hardware compared to Win, I completely ignore them for now!
It's sad, but that's the way it will be until "Blizzard delivers Linux builds of WoW, Diablo, Starcraft" if you get my metaphor? - jhericoAdventurer
"rupy" wrote:
So this connects directly to the Oculus official binaries? What else do I need for this to work?
There is no official Oculus binary that can be used by a Jar right now, because it has to be a shared library (i.e. a DLL or a .so file). The binaries are built from my Github repository which is a copy of the official SDK with a couple of fixes added."rupy" wrote:
Make a tutorial: Download this and that, extract these ddls, .so etc. do this do that... so we can judge how much effort is involved.
Well, I did post this and also this. The latter link to reddit has more detail on what a developer needs to to integrate this if they're using Maven. There's a github project here that consists of two files, a maven POM file and a Java application that you can use to try it out."rupy" wrote:
"jherico" wrote:
LWJGL works fine for me on Linux. I haven't really tried OSX, but they do have binaries for that platform, so I don't know what you mean by 'not running properly'
Well this is really subjective but since there has been trouble for me, I suspect there will be trouble for others too:
- With linux (latest everything) on old X61s (First integrated Intel graphics with hardware 3D) I have flickering of display lists, it breaks the game completely.
Maybe don't use display lists? They're an archaic (and deprecated) way of using OpenGL, so it's hardly surprising that they might not get attention in terms of bug fixes. I also suspect that the blame for any such issue would lie with the GL driver on the platform, not with LWJGL."rupy" wrote:
There are not enough users and/or developers of LWJGL to make these platforms AAA-title stable on all hardware on these operatives with legacy OpenGL.
Again, I don't really see how this has anything to do with LWJGL in particular. LWJGL primarily acts as a simple wrapper around the C methods. - rupyHonored GuestCan you make a zip file with your jocular complete with java source and binaries? I already integrated your HID stuff which was a complete waste of time so I'm a "burnt customer".
About my issues with LWJGL they might be Intel/Linux/Apple related but that still doesn't make the operative problem go away.
Vertex buffers are really horrible in my opinion, code vise... but I'll get there some day if the game is fun at all.
Just had a friend with a discrete GPU try my game, 1300 FPS! No wonder all other demos make me sick... The Rift should come with a warning; "Use only with powerful discrete graphics, Intel HD won't do!" sticker on it!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 11 years ago