D2X-XL and the Oculus Rift

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

D2X-XL and the Oculus Rift

Postby materialdefender » Sat Aug 25, 2012 11:21 am

Hello karx11erx,

I'd kindly like to ask whether there is any chance for supporting the Oculus Rift ( http://www.kickstarter.com/projects/152 ... o-the-game ) in D2X-XL? For those who haven't heard of this project: the Rift ist presumeably the first inexpensive, but still usable and very convincig virtual reality headset, praised (and in fact used) even by the godfather of 3D-gaming, John Carmack. Playing Descent with this thing has to be simply fantastic. Although I'm not 100% sure, whether a mere humans stomach will be able handle this... ;-)

Basic rendering support shouldn't be too hard to implement considering the fact that D2X-XL already supports stereoscopic rendering. Left and right images would have to be rendered side-by-side at 640x800 pixels each and some barrel distortion would have to be added to compensate for the Rift's lenses (see picture below). Most convenient way to do this would either be using a shader or some 'hack', like rendering to an offscreen surface and then mapping that to the inner side of a sphere segment. In addition to the rendering part some work would have to done to implement support for the Rift's tracking sensors.

Being a backer of the project myself, I will be able to supply the SDK once it is out (december 2012), which most likely will ease the process even more. If you don't want to implement this yourself because you (totally understandably!) finally feel to have done enough with this whole Descent thing, I will do (or at least try) it myself. But considering my rather lackluster C++ skills and your experience with the codebase, I guess you would be at least ten times faster than I could ever hope to be.

BTW. Thanks for keeping my all time favorite 3D-game alive for such a long time.
Attachments
rift_example.jpg
rift_example.jpg (55.19 KiB) Viewed 9044 times
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: D2X-XL and the Oculus Rift

Postby Sirius » Mon Aug 27, 2012 4:38 pm

It would be really quite nice if people who make these kinds of rendering modes didn't require games to explicitly support them. It reminds me of audio in the early 1990s...
quadrophoeniX
Posts: 33
Joined: Mon Apr 11, 2011 3:12 pm

Re: D2X-XL and the Oculus Rift

Postby quadrophoeniX » Tue Aug 28, 2012 4:20 pm

Yes it would be wonderful, as framesequential rendering would have been. When I put that request for the first time Karx11erx said he might finish that project when somebody would sponsor the hardawre in need. Unfortunately, after proposing so fhe made clear he currently would neither have got the time nor the incentive to pursue that project any further, so I doubt we'll see any of this happen... Still, I come back lurking every now and then to see whether he might change his mind eventually....
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: D2X-XL and the Oculus Rift

Postby materialdefender » Wed Aug 29, 2012 12:04 am

I will try this myself sometime in the next few weeks. Descent ist simply a must for the Rift. I already have the disrortion code in place as Direct3D shader, porting it to OpenGL should be really simple.

I just didn't have the time so far to take an in depth look into D2X-XLs anaglyph stereo rendering code, but I'm pretty sure that most of the things needed for supporting the Rift are already in place. I'm relatively confident that I will figure things out, although there seems to be a certain lack of comments in the code... :?
quadrophoeniX
Posts: 33
Joined: Mon Apr 11, 2011 3:12 pm

Re: D2X-XL and the Oculus Rift

Postby quadrophoeniX » Wed Aug 29, 2012 11:58 am

materialdefender wrote:Descent ist simply a must for the Rift.

Descent is and always has been - generally speaking - a must for S3D ;)

materialdefender wrote:I just didn't have the time so far to take an in depth look into D2X-XLs anaglyph stereo rendering code, but I'm pretty sure that most of the things needed for supporting the Rift are already in place.
Yeah, splits up the paralaxes already. No color filtering and creating an SBS output was "all" that's needed. Which leaves....

materialdefender wrote: I already have the disrortion code in place as [...] shader,

the only missing bit for the Rift...

materialdefender wrote: I'm relatively confident that I will figure things out, although there seems to be a certain lack of comments in the code... :?


dang I wanted to hold of until the HiRes consumer, now I'm almost forced to back-up :rant:
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: D2X-XL and the Oculus Rift

Postby karx11erx » Wed Aug 29, 2012 1:19 pm

D2X-XL has a frame post processing stage, and it can render to frame buffers. You need to enable frame buffer rendering (check how it is done for stereoscopic rendering), and apply the distortion shader for both eyes' frames. You can do that instead of merging the two frames to the final stereoscopic image. I can look up the files and functions later (weekend) and name them here.

D2X-XL has a shader manager allowing you to conveniently create and access shader programs and their variables.
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: D2X-XL and the Oculus Rift

Postby materialdefender » Wed Aug 29, 2012 6:13 pm

@quadrophoeniX:

It might be a liitle bit more difficult than you think, since support for the Rifts headtracker has to be implemented too for real immersion. And, as always: the devil is in the details. :wink:

I don't think you will regret supporting the Kickstarter project. After all the dev kit isn't that expensive and I think there will be plenty of stuff to play with (most likely even Miner Wars!).

@karx11erx:

Some additional information would be really helpful, thanks in advance!

For now I have the basics working, simply by replacing one of your anaglyph shaders. But I wouldn't say I have a good grasp of the whole pipeline so far. While this simplistic approach basically works, it's not a good solution anyway since this way both frames are rendered at full res before the shader is applied, meaning half of the pixels are wasted in the shader.

Obviously some more work is needed for the HUD... Hopefully it's not too big a task to render that to an offscreen buffer too, otherwise I will simply draw it twice over the warped image. Might look weird with the cockpit enabled, but without the cockpit I guess it will be fine even undistorted.

The screenshot below has left/right images inverted so it can be viewed with the cross-eyed method.
Attachments
Lunar_Outpost-0000.jpg
Lunar_Outpost-0000.jpg (114.45 KiB) Viewed 8982 times
quadrophoeniX
Posts: 33
Joined: Mon Apr 11, 2011 3:12 pm

Re: D2X-XL and the Oculus Rift

Postby quadrophoeniX » Thu Aug 30, 2012 4:23 pm

woohooo, Rift, here I come :bounce:

materialdefender wrote:. And, as always: the devil is in the details. :wink:

Like the HUD ;) ... I understand that the headtracker needs to be implemented but that's apart from the S2D rendering and I'll go for it just with the latter.... As said, you just sold me on the Rift.....
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: D2X-XL and the Oculus Rift

Postby karx11erx » Thu Aug 30, 2012 6:01 pm

All you need to do is force the screen res to 800x600 when the rift mode is enabled. You could use the unused quad buffering mode for this (stereo mode == -1 then).
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: D2X-XL and the Oculus Rift

Postby materialdefender » Thu Aug 30, 2012 9:39 pm

The Rift uses two images at 640x800, but I guess that was what you meant. I'm 99% sure that quad buffering in not available on newer GeForce-cards though. Pretty sad, but nVidia crippled those severely OpenGL-wise to sell more Quadros. But I will try it, maybe I'm wrong.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: D2X-XL and the Oculus Rift

Postby karx11erx » Thu Aug 30, 2012 10:55 pm

I didn't mean you should use quad buffering. You should use that rendering path for the rift. You can set the screen res to 640x800, too.
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: D2X-XL and the Oculus Rift

Postby materialdefender » Thu Aug 30, 2012 11:10 pm

Thanks for clarifying. The wonders of human communication... :wink:
materialdefender
Posts: 22
Joined: Sat Aug 25, 2012 10:36 am

Re: D2X-XL and the Oculus Rift

Postby materialdefender » Fri Aug 31, 2012 10:07 am

Before I try to rewrite/extend your framebuffer code: was there any specific reason not to implement a multisampled FBO? Some sort of antialising is more or less a must for the Rift and I'd rather go with MSAA instead of supersampling the whole image or do some Post-AA.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: D2X-XL and the Oculus Rift

Postby karx11erx » Fri Aug 31, 2012 1:18 pm

No, there wasn't.
quadrophoeniX
Posts: 33
Joined: Mon Apr 11, 2011 3:12 pm

Re: D2X-XL and the Oculus Rift

Postby quadrophoeniX » Fri Aug 31, 2012 1:49 pm

materialdefender wrote:I'm 99% sure that quad buffering in not available on newer GeForce-cards though. Pretty sad, but nVidia crippled those severely OpenGL-wise to sell more Quadros. But I will try it, maybe I'm wrong.

No, you ain't.... :( 3DVision on Gefoce = NO OGL S3D Which is why I am so sad that TitaniumGL wrapper dosn't work on D2X-XL....

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests