Page 1 of 49

Minecrift Discussion Thread

Posted: Sun Apr 14, 2013 2:26 pm
by Jademalo
.


To download the mod, Look here! Thank you StellaArtois and mabrowning!

Click here to visit the Minecrift Site!

Looking for a server with other Rift users? Join us at MetaCraft!
Image




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: http://www.mtbs3d.com/phpbb/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.

Thanks!



If anyone is interested in this, here are the links for the two mods you would need to get GLSL working in Minecraft;
http://www.minecraftforum.net/topic/154 ... -karyonix/
http://optifine.net/home.php

And the spesific downloads that work with the latest MC version (1.5.1);
http://optifine.net/adloadx.php?f=OptiF ... D_U_B3.zip
http://www.mediafire.com/?c0q1dq5ve4hhlkd
(To install those, delete META-INF, Install Optifine First and GLSL Second, shaders go in the shaders folder and are enabled in a menu inside Minecraft itsself)



This was the shader from the other thread;

Code: Select all

#version 120

uniform sampler2D bgl_RenderTexture;

const vec2 LeftLensCenter = vec2(0.2863248, 0.5);
const vec2 RightLensCenter = vec2(0.7136753, 0.5);
const vec2 LeftScreenCenter = vec2(0.25, 0.5);
const vec2 RightScreenCenter = vec2(0.75, 0.5);
const vec2 Scale = vec2(0.1469278, 0.2350845);
const vec2 ScaleIn = vec2(4, 2.5);
const vec4 HmdWarpParam = vec4(1, 0.22, 0.24, 0);

// Scales input texture coordinates for distortion.
vec2 HmdWarp(vec2 in01, vec2 LensCenter)
{
   vec2 theta = (in01 - LensCenter) * ScaleIn; // Scales to [-1, 1]
   float rSq = theta.x * theta.x + theta.y * theta.y;
   vec2 rvector = theta * (HmdWarpParam.x + HmdWarpParam.y * rSq +
      HmdWarpParam.z * rSq * rSq +
      HmdWarpParam.w * rSq * rSq * rSq);
   return LensCenter + Scale * rvector;
}

void main()
{
   // The following two variables need to be set per eye
   vec2 LensCenter = gl_FragCoord.x < 640 ? LeftLensCenter : RightLensCenter;
   vec2 ScreenCenter = gl_FragCoord.x < 640 ? LeftScreenCenter : RightScreenCenter;

   vec2 oTexCoord = gl_TexCoord[0].xy;
   //vec2 oTexCoord = (gl_FragCoord.xy + vec2(0.5, 0.5)) / vec2(1280, 800);  //Uncomment if using BGE's built-in stereo rendering

   vec2 tc = HmdWarp(oTexCoord, LensCenter);
   if (any(bvec2(clamp(tc,ScreenCenter-vec2(0.25,0.5), ScreenCenter+vec2(0.25,0.5)) - tc)))
   {
      gl_FragColor = vec4(vec3(0.0), 1.0);
      return;
   }

   //tc.x = gl_FragCoord.x < 640 ? (2.0 * tc.x) : (2.0 * (tc.x - 0.5));  //Uncomment if using BGE's built-in stereo rendering
   gl_FragColor = texture2D(bgl_RenderTexture, tc);
}

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 2:38 pm
by MrGreen
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 it.

I'd be floored if it didn't come out in the next few weeks.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 2:49 pm
by Jademalo
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 2:52 pm
by MrGreen

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 3:06 pm
by Jademalo
I guess that's me told!

I hadn't seen that, thank you!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 3:12 pm
by MrGreen
Jademalo wrote:I guess that's me told!

I hadn't seen that, thank you!
Well you're very welcome! :)

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 3:16 pm
by Jademalo
You've got me excited now =p
Fingers crossed that support comes out before I get my rift, I was beginning to loose hope that it was actually being worked on.
Thanks again!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 3:24 pm
by mrklaw
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 4:12 pm
by Jademalo
mrklaw wrote: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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 4:30 pm
by MrGreen
Sure, but I'm afraid that the absence of head tracking is a one way ticket to Puketown.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 4:32 pm
by jf031
MrGreen wrote: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 it.

I'd be floored if it didn't come out in the next few weeks.
I'd be floored if it did. Jeb (the current lead on Minecraft) isn't saying anything about the Rift on his Twitter. I doubt it is from the lack of being asked about it.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 4:34 pm
by MrGreen
jf031 wrote:
MrGreen wrote: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 it.

I'd be floored if it didn't come out in the next few weeks.
I'd be floored if it did. Jeb (the current lead on Minecraft) isn't saying anything about the Rift on his Twitter. I doubt it is from the lack of being asked about it.
Silence you. Crusher of hope!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 4:37 pm
by jf031
MrGreen wrote:
jf031 wrote:
MrGreen wrote: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 it.

I'd be floored if it didn't come out in the next few weeks.
I'd be floored if it did. Jeb (the current lead on Minecraft) isn't saying anything about the Rift on his Twitter. I doubt it is from the lack of being asked about it.
Silence you. Crusher of hope!
Heheh. Well, I was wrong about the most recent shipping update...

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 14, 2013 6:07 pm
by mattyeatsmatts
Oculus Rift game controller input

Postby notch ยป Tue Feb 26, 2013 7:48 pm
Hi! 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

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 4:19 am
by StellaArtois
Hi guys, been lurking for a while, time to start posting!

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 ... _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.
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!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 6:39 am
by Lilwolf
I don't own minecraft on pc (just android). I would buy it in a second if there was good rift support.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 11:15 am
by Jademalo
StellaArtois wrote:Hi guys, been lurking for a while, time to start posting!

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 ... _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.
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 11:46 am
by StellaArtois
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!)

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 12:30 pm
by Jademalo
StellaArtois wrote: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!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 1:34 pm
by Ben
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Mon Apr 15, 2013 6:18 pm
by 3devious
If it had Rift and Hydra support, people would never leave the house!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 16, 2013 11:06 am
by Marulu
It would be great if it also would also be supporting the Hydra, or an normal Xbox 360 controller because using a keyboard in VR sucks.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 16, 2013 5:02 pm
by Jademalo
Oh man, Imagine the cheesy left hand thrust down to place, right hand making a hammering motion to dig. It's horribly stereotypical of terrible motion controls, but goddamn that would be immersive.

And destructive when you loose your bearings and hit the cat

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 16, 2013 5:05 pm
by Mystify
Jademalo wrote:Oh man, Imagine the cheesy left hand thrust down to place, right hand making a hammering motion to dig. It's horribly stereotypical of terrible motion controls, but goddamn that would be immersive.

And destructive when you loose your bearings and hit the cat
I want to say someone already made a mod to do that

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 16, 2013 5:57 pm
by Jademalo
Mystify wrote:
Jademalo wrote:Oh man, Imagine the cheesy left hand thrust down to place, right hand making a hammering motion to dig. It's horribly stereotypical of terrible motion controls, but goddamn that would be immersive.

And destructive when you loose your bearings and hit the cat
I want to say someone already made a mod to do that
It should be pretty easy to do with the motion creator. If I do it how I'm thinking, sword slashes should work automatically with a swing too.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Thu Apr 18, 2013 3:05 pm
by StellaArtois
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).
2013-04-18_21.53.42.png
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Thu Apr 18, 2013 3:45 pm
by space123321
Images are not merging through the eyes of my Rift...

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Thu Apr 18, 2013 3:59 pm
by EdZ
I think the right and left eye views may be reversed.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Fri Apr 19, 2013 12:07 am
by StellaArtois
Ok thank you, more work to do evidently!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sat Apr 20, 2013 3:07 am
by StellaArtois
Ok next set of Rift'ys for people to try. I'm hoping these will be better - should be using the projection as specified in the SDK. This would be easier if I had my own DK (still waiting)! :-D
2013-04-20_09.59.54.png
2013-04-20_09.59.26.png

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sat Apr 20, 2013 5:03 pm
by boone188
I don't have my Rift yet (next week!) but I can tell you this looks good now. Great work!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sat Apr 20, 2013 5:16 pm
by BullittClay2
I tried looking at the image with the Rift - and it works! Nice job. Totally has the right 3D effect.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 21, 2013 6:45 am
by StellaArtois
Ok excellent, thanks guys! Progress! :-) Now trying to get the GUI duplicated on both eyes... Will report back soon.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 21, 2013 9:31 am
by Jademalo
Oh man, this is looking incredible!

Fantastic work, can't wait to see what this is like when you're finished and when I get my DK!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Sun Apr 21, 2013 9:45 am
by space123321
Now we are talking - looks perfect in the Rift! Sooo looking forward to this!

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 23, 2013 9:53 pm
by defactoman
Good work, looks promising! The images came across great on my rift

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Tue Apr 23, 2013 11:09 pm
by shakesoda
What parameters are you using now? I'm having convergence troubles in my own code (just like your first distorted images).

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Wed Apr 24, 2013 3:50 am
by StellaArtois
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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Fri Apr 26, 2013 11:09 am
by stinkvis
MrGreen wrote: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.

Re: Rudimentary Minecraft Rift Support - Is it feasible?

Posted: Fri Apr 26, 2013 11:22 am
by DFP
I've played Minecraft in Eyefinity, 5400x1920 resolution, 72 inches right up in your face and it's pretty immersive. This will be a great game for the Rift.