One of the things I've really been looking forward to playing on the rift is Minecraft, because I can't think of anything more relaxing than building a house, and feeling the sheer scale of the whole thing.This has been looking less and less likely in the immediate future, due to all of the main driver based solutions being DirectX based, whereas Minecraft is OpenGL.

Then, as I was messing around with mods, I had an idea. Minecraft has had a GLSL shader mod for years, and I wondered whether or not it would be possible to implement the Oculus warp through that. Unfortunately, I have absolutely no knowledge of GLSL, but I thought it might be possible.

After doing a bit of digging (lol), I came across this thread: viewtopic.php?f=140&t=17081 from two days ago. This seems to be a GLSL warp shader, but its for BGE. I spent about half an hour trying to get it to work inside Minecraft (Which uses GLSL 120 if I'm not mistaken) but I then realised I had absolutely no idea what I was doing, and that it would probably be a heck of a lot easier simply asking someone who had a bit more of a clue than I did.

My knowledge is limited - but am I right in thinking that in the driver based solutions that exist for Non-Rift ready games, the "Head tilt" (Roll?) axis of motion with the rift is generally done by the shader, and then the standard x and y done by overtaking the mouse? If that's the case, is the roll possible to implement with GLSL, and is it a feasible possibility to implement a Minecraft Rift mod using this? (And some sort of side program to bind rift X and Y tracking to mouse movement?) My knowledge at present is limited, but I am trying to learn. If I'm wrong about the x and y axis, my entire understanding is based on how Viero handles Skyrim in that if you plug in a controller, they no longer work due to mouse being disabled completely when the game detects a controller.

If this is possible, I will be even more excited for my Dev kit arriving that I could possibly imagine. I've had a search around, but I cannot find any sort of attempt at Rift implementation in Minecraft, only people talking about how awesome it would be. I thought I'd see if I could get something going myself, but my knowledge is just too limited to really get any sort of headway.

I remember seeing them talking about it a few months ago, but since than I've not heard anything. I do know that they got Dev kits a good few months ago, it was on their twitter. If it was in the near future, I would've expected them to be generating a bit of a buzz around it since the rifts are shipping, but I've heard nothing at all.

I'm sure it's doable. I play occasionally with a 3D mod that works on my 3DTV, and I like sonic ethers shaders. Seems like the graphics part shouldn't be a big issue. Biggest initial hurdle would be the input reading from the head tracker and getting that into java.

I'm sure it's doable. I play occasionally with a 3D mod that works on my 3DTV, and I like sonic ethers shaders. Seems like the graphics part shouldn't be a big issue. Biggest initial hurdle would be the input reading from the head tracker and getting that into java.

Would it be worth simply implementing the warp to start with, without head tracking? By the sounds of the above interview Notch has been trying to get it implemented in Java, but as an interim solution until official support comes out it might be worth it if it doesn't take too long.

Postby notch » Tue Feb 26, 2013 7:48 pmHi! I'm trying to add Oculus Rift support to LWJGL so it'll be accessible for 0x10c and Minecraft, and keep running into annoying LWJGL native compilation errors. But when I start up LWJGl with the rift connected, it lists it as a game controller with no inputs, and that made me think..

It would be incredibly cool for the Rift to assign six axis as a game controller input (all rotations and movements). Then it would automatically work in all game libraries that support controllers without requiring special code for it. Is anything like that planned?

this is from the official rift developers forum, so yeah just shows notch is actively trying to get minecraft onto the rift, thought this may interest you

This is something I've been interested in as well. I've started playing around with the decompiled minecraft source, and the MCP guys have done a fantastic job of renaming the classes and variables, it looks like normal java source! While I've got quite a bit of Java and C++ experience I have exactly two days OpenGL experience as of now. The prospect of Minecraft on the Rift has spurred me into playing around with stuff as part of a learning process...

Using powback's JNI wrapper for the Oculus SDK (thanks powback! http://www.reddit.com/r/oculus/comments/1c1vh0/java_wrapper_for_devs/), I think head tracking should be working (for now head tracking would effectively move the selection cursor; not ideal, but will do for a start). Roll is supported (just roll the 'middle' eye modelview I assume).

I've also updated the JNI wrapper to pass back the correct Stereo render parameters from the SDK, and have two (currently undistorted) viewports up and running.

Attachment:

2013-04-14_23.34.13.png

Not sure if the rendering parameters are correct - the trouble is I won't have my Rift until the end of May so I can't check this stuff easily. Not sure if the IPD scale is correct either. The GUI currently displays on one viewport only, but that can be easily fixed (it's just grunt work to go through all of the sub-GUI functions).

Now I've seen your initial post Jademalo, I'm slightly concerned about this GLSL stuff. I assumed for the distortion I need to render to a (scaled up) texture, and then run the previously posted OpenGL shader code on it, rendering this output to the screen. Why is the GLSL stuff problematic in Minecraft? Does it's GL lib not support this or something? Please pardon my ignorance on this!

You do not have the required permissions to view the files attached to this post.

This is something I've been interested in as well. I've started playing around with the decompiled minecraft source, and the MCP guys have done a fantastic job of renaming the classes and variables, it looks like normal java source! While I've got quite a bit of Java and C++ experience I have exactly two days OpenGL experience as of now. The prospect of Minecraft on the Rift has spurred me into playing around with stuff as part of a learning process...

Using powback's JNI wrapper for the Oculus SDK (thanks powback! http://www.reddit.com/r/oculus/comments/1c1vh0/java_wrapper_for_devs/), I think head tracking should be working (for now head tracking would effectively move the selection cursor; not ideal, but will do for a start). Roll is supported (just roll the 'middle' eye modelview I assume).

I've also updated the JNI wrapper to pass back the correct Stereo render parameters from the SDK, and have two (currently undistorted) viewports up and running.

Attachment:

2013-04-14_23.34.13.png

Not sure if the rendering parameters are correct - the trouble is I won't have my Rift until the end of May so I can't check this stuff easily. Not sure if the IPD scale is correct either. The GUI currently displays on one viewport only, but that can be easily fixed (it's just grunt work to go through all of the sub-GUI functions).

Now I've seen your initial post Jademalo, I'm slightly concerned about this GLSL stuff. I assumed for the distortion I need to render to a (scaled up) texture, and then run the previously posted OpenGL shader code on it, rendering this output to the screen. Why is the GLSL stuff problematic in Minecraft? Does it's GL lib not support this or something? Please pardon my ignorance on this!

Holy crap, that sounds like the hard bit!

I can't really help you much, since my knowledge is extremely limited. GLSL isn't problematic in Minecraft, but I believe that there is no support for it in the native engine. If you have those mods installed, then it should just accept standard GLSL shaders, but I know nothing about GLSL. The thing I posted above was the GLSL shader for the distortion obviously, so if you can get that working with MC's GLSL mod then that's pretty much full support, except for aim detatch.

As far as I can tell currently (although again, just learning this stuff now so take this with a pinch of salt) the LWJGL lib seems to support all the necessary OpenGL stuff. So unless the native implementation stuff is missing, I'm hoping it should work without any additional mod packages. We shall see!

Aim detach sounds more tricky! Maybe for version 1.1 Or maybe notch will beat us to it with full DK1 support (proper! Non hacked!)

As far as I can tell currently (although again, just learning this stuff now so take this with a pinch of salt) the LWJGL lib seems to support all the necessary OpenGL stuff. So unless the native implementation stuff is missing, I'm hoping it should work without any additional mod packages. We shall see!

Aim detach sounds more tricky! Maybe for version 1.1 Or maybe notch will beat us to it with full DK1 support (proper! Non hacked!)

Good luck getting it to work, keep us updated on your progress please!

The GLSL source above has actually been edited a bit for compatibility with the Blender Game Engine, there's a thread here with details and the original version.

The OVR SDK should have all the necessary functions for calculating the correct parameters to pass through if you want the settings to be adjustable, and you don't HAVE to render to a larger texture. It doesn't actually matter from the point of view of the shader since the texture coordinates are normalized.

Last edited by Ben on Sun May 05, 2013 11:21 pm, edited 1 time in total.

A little more progress. GLSL seems to work fine in Minecraft without any mods. I'll have to target OpenGL 3+ I believe though. Managed to get the distortion shader generally working (again, the parameters may be off).

Attachment:

2013-04-18_21.53.42.png

Attachment:

2013-04-18_21.54.03.png

Issues:- Got a few OpenGL rendering issues to sort out as well on the right eye (OpenGL n00b strikes again)- Need to supersample the hell out of the image, super aliasing present- Hand rendering is wrong currently- GUI needs to be duplicated on both screens for now.

Getting there however. Slowly. Would be easier if notch just released the real version

Edit: any input from people with their Rift viewing the above images appreciated. Do they look ok, plain wrong etc? IPD is at 64mm default atm.

You do not have the required permissions to view the files attached to this post.

Basically, I had to make sure I used the *exact* left and right projection matrices, as supplied by the StereoEyeParameters class in the Lib OVR SDK. No translation, just use the matrix completely as is, except with custom near and far planes set. I also use the viewport translation directly (currently) for correct IPD separation of views.

I think a few failings with the current Oculus SDK and it's StereoEyeParams class are:

- For projection matrix creation, we need the ability to specify near and far planes. Currently defaults of 0.05f and 1000.0f are used.- For the viewport translation, there is currently no support (that I can see - I may be wrong on this) that allows you to get a viewport translation based on inputted yaw, pitch and roll and the rudimentary neck model. That would be useful - I'm having to roll my own code for this at the moment.

Mojang is looking to implement Rift support. Notch did't confirm when or if it would come out but he did say they had one guy looking into.

I wouldn't hold your breath if I were you. Mojang promised to release an official modding API 2 years ago. Instead we got boring terrain generation, flower pots, and the reintroduction of several rendering bugs that had been fixed in early beta.Even if they do add rift support at some point, I'm willing to bet it will already have been done better by the community in 1/10th of the time it costs mojang to release their own half-assed implementation.

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum