Biclops - Open RIFT-Compatibility layer

This is for discussion and development of non-commercial open source VR/AR projects (e.g. Kickstarter applicable, etc). Contact MTBS admins at customerservice@mtbs3d.com if you are unsure if your efforts qualify.
TheInevitable
One Eyed Hopeful
Posts: 5
Joined: Fri Jul 06, 2012 9:07 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by TheInevitable »

What FOV changes are needed? And couldn't that be set inside the game (provided the game allows changing the FOV)?
defactoman
Cross Eyed!
Posts: 116
Joined: Tue Jun 19, 2012 12:15 pm
Location: Lompoc, CA

Re: Biclops - Open RIFT-Compatibility layer

Post by defactoman »

It also worked for me as well. Latest patched version, dropped files in folder, set the resolution and it loaded fine with the split warped screen.
Emerson
One Eyed Hopeful
Posts: 34
Joined: Wed Jun 13, 2012 11:16 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by Emerson »

Piggybacking an existing 3D driver is a clever idea, and not something I had thought of. It might be possible, but it's probably ugly to try and insert two layers into the stack at once without stepping over each others' feet. On the other hand, there's the possibility that if you get it working once, you'd just have to do it once, and not vary the implementation per game, which would be a win.

What I'm kinda worried about is that, for most of these intercept-layer style software, they'll explicitly load the system32 directx DLLs manually by direct path (otherwise, if they used normal mechanisms, they'd risk intercepting their own loading). That doesn't exclude doing some shady things by, e.g., modifying the system32 DLLs, or installing a kernel-level driver to hook the windows loading routines, but it gets more hairy and possibly less stable.
TheInevitable
One Eyed Hopeful
Posts: 5
Joined: Fri Jul 06, 2012 9:07 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by TheInevitable »

Well, Fraps, I know, works fine with TriDef, so, if they can do it alright, then it means its possible. According the first link I posted, Fraps uses:
SetWindowsHookEx(WH_CBT, &FrapsProcCBT, hModuleFrapsDLL, 0);
to hook into other processes (and I think that function is built into Windows, so no installation or hacks are required to hook into another process), and I haven't read anything about it using the DX DLLs (though I guess that doesn't mean it doesn't). EasyHook has tutorials and documentation which might say for sure; I'll look at them later even though I'll likely not understand much. ;)

EasyHook, from further reading, seems pretty stable; likely a lot more so than if you wrote your own hooks since it has a better installed based to find bugs. However, since its open source and you really only need to get it working with TriDef and/or IZ3D, then, if there are any bugs, those can be fixed and then it'll work for all TriDef/IZ3D-supported games.

Also, I found another project that's based on EasyHook that hooks into Direct3D (its actually made by the same guy), which would likely make it even easier to see if Game->TriDef->Distortion would work:
http://spazzarama.com/2011/03/14/c-scre ... api-hooks/
https://github.com/spazzarama/Direct3DHook
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by cybereality »

@TheInevitable: I am not using a proxy DLL in my method. And I have come across some of those same links, but thanks for posting. In terms of combining with existing drivers: that will be very limited. About the most you could do like that is add in the pre-warping. You would not be able to easily change the aspect ratio, alter the FOV, provide for full head-tracking (aka roll), or basically do any fun stuff. For me its these kinds of fun things (and the options for future features like haptic force-feedback, ambilight, etc.) that got me interested in doing a 3D driver.
TheInevitable
One Eyed Hopeful
Posts: 5
Joined: Fri Jul 06, 2012 9:07 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by TheInevitable »

I think that's pretty cool what you're doing; it will definitely make the games you develop for truly immersive and more fun.

The main thing, of course, however, is that it seems that that would only really work with single player games, because it seems like it'd get the user ban'd from any online game with cheat detection (if I'm understanding what you're doing remotely correctly, which obviously wasn't the case with the proxy DLL assumption ; ). The ideal would be for game developers to build that stuff in themselves, and I do think we'll get there eventually. Lots of good things ahead!

But, to me, it seems like the biggest obstacle to Rift's adoption and potential popularity would be its game support. And, so, at minimum, we would just need either a 3D + pre-warping driver that would work with most stuff or a pre-existing 3D driver + pre-warping on top of it. You and Emerson are the real programmers; I don't know which option would be easier/most compatible/optimal, but I just figured that the latter would require the least amount of code & time to implement and support. But if each game has to be supported individually, then the total number of games that will ever be supported is basically: the number of programmers developing for the rift times the number of games they own. Because its all volunteer work, that list is likely to not be very long (or at least not as long as it could/should be). If hundreds of games are supported out of the box, I think the Rift would end up flying off of the shelves, giving developers more incentive to support it and VR gaming. =)

EDIT: the past tense form of "ban" is an offensive word and gets replaced with "spanked"?!?
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by cybereality »

@TheInevitable: Well users can still use existing DDD or IZ3D drivers if they want, they do provide a playable experience. Its just not an optimal experience. Even adding in the pre-warping, you still have the problem of the aspect-ratio. With IZ3D there is a beta mode where you can render the game in a non-squished aspect ratio (meaning 8:9). I haven't tried it myself, but Palmer said it was buggy and only works with some games. DDD does not even have that. So that's probably the biggest problem right now.

In terms of anti-cheat software: I would *NOT* recommend anyone attempt to play online with either Emerson's or my driver. That is probably a quick ticket to getting ban'd (dunno why that's considered a curse word...). Of course, you could play on non-VAC, non-PunkBuster servers and that will probably be OK.
Laserschwert
Cross Eyed!
Posts: 108
Joined: Mon Aug 06, 2012 11:28 am

Re: Biclops - Open RIFT-Compatibility layer

Post by Laserschwert »

I was wondering, all the screenshots and videos of games "prepared" for the RIFT (and even the Doom³ shots from E3 and QuakeCon) have black borders around them. Is it actually necessary to cut off all this image information when distorting the image? Couldn't you render a larger version of the view, with a bigger FOV and then "zoom" into the distorted image to get rid of the black borders? Or are these areas not visible through the RIFT's lenses anyway?

Sorry for sounding like the noob I am ;)
EdZ
Sharp Eyed Eagle!
Posts: 425
Joined: Sat Dec 22, 2007 3:38 am

Re: Biclops - Open RIFT-Compatibility layer

Post by EdZ »

I think it's a function of 'retrofitting' RIFT support to the engine. It's easier to render the scene in the normal rectilinear manner then warp it for the RIFT's optics in a shader pass than it is to render it taking the distortion into account when projecting the world. The latter would be the more elegant way to do it, and may be very slightly faster (the post-warp can be omitted, but I don't know how much GPUs themselves are designed to optimise rectilinear rendering), but the post-warp method is vastly easier, and if a new RIFT successor came out with a different set of optics with a different warp, it's also easier to change the post-warp than change rendering projection.
I guess you could also render a rectilinear but non-square (or square but with a no-render mask) such that the edges of the image will remain just outside the visible frame, but then you would end up with an oddly sized buffer, and just sticks of Dirty Hack.
Laserschwert
Cross Eyed!
Posts: 108
Joined: Mon Aug 06, 2012 11:28 am

Re: Biclops - Open RIFT-Compatibility layer

Post by Laserschwert »

Ah well, also I have to rectify myself: After reading through cyberreality's thread I realized that his images don't have black borders. So it would be interesting to know if the post-process warping shows any rendertime differences compared to whatever cyber does...
Emerson
One Eyed Hopeful
Posts: 34
Joined: Wed Jun 13, 2012 11:16 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by Emerson »

It's a problem of tradeoffs--the nice thing about the black border solutions is that the center pixel is still a pixel. With the same distortion, if you were to enlarge the whole thing to not have black borders, then the center pixels would be larger than a physical pixel, and at the low resolutions we're playing with, every pixel counts.

On the other hand, it might be possible to render at a higher resolution and essentially fullscreen anti-alias into the final buffer, to avoid the problem before, but then you're eating performance in a very latency-critical system.

Sooo, tradeoffs. ;)
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by cybereality »

I think I am doing my warp shader similar to Emerson (he helped me with the code). But I am rendering to a quad with texture clamp on (which means it uses the last pixel on the edge and just stretches it). This works pretty well. I guess Emerson is using border mode, which would be a solid color.

Here is the code that sets that mode:

Code: Select all

device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
device->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_CLAMP);
Laserschwert
Cross Eyed!
Posts: 108
Joined: Mon Aug 06, 2012 11:28 am

Re: Biclops - Open RIFT-Compatibility layer

Post by Laserschwert »

cybereality wrote:I am rendering to a quad with texture clamp on (which means it uses the last pixel on the edge and just stretches it).
Wow, didn't notice that... works pretty well! And I guess for peripheral vision it's good enough...
jonnycowboy
One Eyed Hopeful
Posts: 4
Joined: Thu Jun 07, 2012 9:51 am

Re: Biclops - Open RIFT-Compatibility layer

Post by jonnycowboy »

Hi all,
I started a "biclops" HTML5/Canvas site and am trying to get the distortion to work correctly based on the equation that was made available. It tracks your head when using a smartphone as the display. It is meant to be used on an iphone or Galaxy Note (my phone) with an FOV2GO or Hasbro 3d viewer. It will track your head.

On Android the best experience is on Firefox Beta, you can also used Chrome but future versions of the software will only work using Firefox (Chrome does not support the accelerometer/gyro info that Firefox does).

You can find it here: http://ljd2.com/biclopsweb/canvas_geometry_cube.html

At the moment it is only a 3D cube. You can copy the code to your site and uncomment the "rotating camera" code. Then you can have fun turning in circles (wireless, remember!) to try and follow the cube (hint: look down).

I was thinking of putting it up on github, anybody interested? Especially looking for help on the distortion code!
Some example distortion code:http://jsfiddle.net/jonnycowboy/5Hr9M/
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: Biclops - Open RIFT-Compatibility layer

Post by brantlew »

that's pretty cool for a quick test. In my PC Firefox browser the cubes always appear on the bottom of the canvas. Is that normal?

It gives me an idea. That would be cool to have a real VR website that was 100% canvas encoded that was only viewable with the Rift. Maybe Oculus should have a section of their website like that. It would be a nice way to quick demo the headset. I guess tracking would require a plug-in though.
jonnycowboy
One Eyed Hopeful
Posts: 4
Joined: Thu Jun 07, 2012 9:51 am

Re: Biclops - Open RIFT-Compatibility layer

Post by jonnycowboy »

Here I adapted it for an FPS style game.
http://ljd2.com/nemesis/indexcanvas.html

I used http://www.isaacsukin.com/news/2012/06/ ... ps-browser as a baseline, pretty easy!

If you'd like to test in a browser on a PC (no movement), you need to get an orientation bookmarklet:
http://louisremi.github.com/orientation-devtool/
atomdude
One Eyed Hopeful
Posts: 11
Joined: Tue Sep 10, 2013 6:22 pm

Re: Biclops - Open RIFT-Compatibility layer

Post by atomdude »

has anyone tried to get it to work on digital combat systems (DCS)? i am desperate!!!
Post Reply

Return to “VR/AR Research & Development”