Oculus Rift support
Moderator: Graf Zahl
-
- Posts: 2
- Joined: Sat Apr 27, 2013 20:38
Oculus Rift support
Hi,
I am looking into porting GZDoom to the Oculus Rift. I received my Rift yesterday and looking for a fun project. I have pretty reasonable coding skills and I believe I am up for it, however I have some questions and I hope some devs/enthusiasts will help me out.
- How is the GLDoom sourcecode compared to the original Doom source? This is very important (as I found the original Doom code not that nice to work with, but being GZDoom uses OpenGL will probably make a huge difference).
- What are the licenses used in GZDoom? How does GZDooms license compare to others?
- Are there any cases of using postprocess shaders? This could save me some time.
- Is there support for stereoscopy somewhere? If not, this could be my subgoal as well as I was looking for stereoscopic doom for some while now.
- Is objectively GZDoom the engine to use to add support for the Rift to?
- Do you have any other thoughts/ suggestions?
Sidenotes:
I am also interested in voxel support. I saw someone implemented them once, but the implementation never made it to a stable release I think. Does anyone know more about it this?
I'm also interested in depth maps of textures, as I was wondering if a reprojection technique could work well (not reprojection stereo, but the same thought behind it).
Also, is there some work done on for example parallax/bump mapped textures? Not completely on topic, but interesting none the less.
My apologies for not finding this all out myself, I'm going to start digging in the code right now and was hoping to get some pointers along the way. Also, good to see this Doom community still going strong! Obviously I cannot promise to be the one actually bringing all these above things to GZDoom, but I'm willing to take a shot at it for at least the basic things and see how that works out. It all depends on how tough it is going to be on this individual, and I really can't make an estimate until I got my compiler brewing some stuff.
Greetings,
Kajos
I am looking into porting GZDoom to the Oculus Rift. I received my Rift yesterday and looking for a fun project. I have pretty reasonable coding skills and I believe I am up for it, however I have some questions and I hope some devs/enthusiasts will help me out.
- How is the GLDoom sourcecode compared to the original Doom source? This is very important (as I found the original Doom code not that nice to work with, but being GZDoom uses OpenGL will probably make a huge difference).
- What are the licenses used in GZDoom? How does GZDooms license compare to others?
- Are there any cases of using postprocess shaders? This could save me some time.
- Is there support for stereoscopy somewhere? If not, this could be my subgoal as well as I was looking for stereoscopic doom for some while now.
- Is objectively GZDoom the engine to use to add support for the Rift to?
- Do you have any other thoughts/ suggestions?
Sidenotes:
I am also interested in voxel support. I saw someone implemented them once, but the implementation never made it to a stable release I think. Does anyone know more about it this?
I'm also interested in depth maps of textures, as I was wondering if a reprojection technique could work well (not reprojection stereo, but the same thought behind it).
Also, is there some work done on for example parallax/bump mapped textures? Not completely on topic, but interesting none the less.
My apologies for not finding this all out myself, I'm going to start digging in the code right now and was hoping to get some pointers along the way. Also, good to see this Doom community still going strong! Obviously I cannot promise to be the one actually bringing all these above things to GZDoom, but I'm willing to take a shot at it for at least the basic things and see how that works out. It all depends on how tough it is going to be on this individual, and I really can't make an estimate until I got my compiler brewing some stuff.
Greetings,
Kajos
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: Oculus Rift support
Very different. While GZDoom's renderer doesn't look much like a typical renderer given that it needs to render things relatively close to how Doom does it, it still is a completely different approach to rendering than what is used in the software renderer.Kajos wrote:- How is the GZDoom sourcecode compared to the original Doom source? This is very important (as I found the original Doom code not that nice to work with, but being GZDoom uses OpenGL will probably make a huge difference).
See [wiki]license[/wiki] on the ZDoom wiki.Kajos wrote:- What are the licenses used in GZDoom? How does GZDooms license compare to others?
All shaders used can be found in gzdoom.pk3:shaders/glsl/Kajos wrote:- Are there any cases of using postprocess shaders? This could save me some time.
No.Kajos wrote:- Is there support for stereoscopy somewhere? If not, this could be my subgoal as well as I was looking for stereoscopic doom for some while now.
Blzut3 wrote some stereoscopy code for the software renderer in ZDoom, though, but I don't know if he released it anywhere. It never made it into the main ZDoom codebase anyway.
Why not?Kajos wrote:- Is objectively GZDoom the engine to use to add support for the Rift to?
The alternatives, as far as OpenGL Doom ports go, are Doomsday, Risen3D, and GLBoom+. (Maybe Vavoom if you want a codebase that will not change anymore, since it seems abandoned.) Then it depends on what you want.
[wiki]Voxel[/wiki] support has been in for a while, actually.Kajos wrote:I am also interested in voxel support. I saw someone implemented them once, but the implementation never made it to a stable release I think. Does anyone know more about it this?
If you mean specifically for OpenGL, maybe you could write on a "proper" OpenGL handling of them, since at the moment they are converted to MD2 (or MD3, I forgot) to be handled by the pre-existing model code. That is not especially optimal since it results in a lot more polygons than necessary. Also, the conversion can take a while when loading a lot of voxels, such as in NerdKoopa's vehicle pack.
I don't think so.Kajos wrote:Also, is there some work done on for example parallax/bump mapped textures? Not completely on topic, but interesting none the less.
-
- Posts: 2
- Joined: Sat Apr 27, 2013 20:38
Re: Oculus Rift support
Thanks for the reply, Gez!
-
- Posts: 1
- Joined: Tue Jun 04, 2013 9:16
Re: Oculus Rift support
The Brutal Doom Mod really has changed Doom for me and added a whole new dimension.
I'd love to play this with my Oculus Rift and wanted to ask if you've been able to make any progress?
Did you receive your Rift yet?
I'd love to play this with my Oculus Rift and wanted to ask if you've been able to make any progress?
Did you receive your Rift yet?
-
- Posts: 15
- Joined: Tue Sep 27, 2005 9:26
- Location: Vancouver, BC
- Contact:
Re: Oculus Rift support
Been away from Doom for far too long and I recently got my kit in. Figured I'd fiddle around with it and get GZDoom running with it before I get too carried away with it at work. Current status as of about 3 days of actual work on it (two half assed weekends):
- based on GZDoom 1.8.2
- head tracking works (all 3 axis)
- stereoscopic rendering for the main pass (no menus, hud, etc)
http://i.imgur.com/v2SEJo1.jpg
It really looks good in 3D. I think the low res art in Doom makes the game far more comfortable with the low resolution of the Rift. I don't really get motion sick like I do with HL2 (Doom 3 is also fine) even though the doomguy moves around at a million miles an hour.
Next up is to get the 2D screens (menus, etc) working with it and then add a post effects framework to apply the barrel distortion.
- based on GZDoom 1.8.2
- head tracking works (all 3 axis)
- stereoscopic rendering for the main pass (no menus, hud, etc)
http://i.imgur.com/v2SEJo1.jpg
It really looks good in 3D. I think the low res art in Doom makes the game far more comfortable with the low resolution of the Rift. I don't really get motion sick like I do with HL2 (Doom 3 is also fine) even though the doomguy moves around at a million miles an hour.
Next up is to get the 2D screens (menus, etc) working with it and then add a post effects framework to apply the barrel distortion.
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
Re: Oculus Rift support
Good to see you around timmie. it's been a while. Interesting developments. I'm not sure how I feel about the OR. I haven't really looked into it (pun!) to much myself though and I was prepared to dismiss it as a gimmick but it does seem to be gaining momentum.
I don't suppose you have a mind to do anything else with GZDoom do you? As you may know, there is no longer any renderer-related development going on but there are a few things that people have asked about might be nice if they could be added. I have nothing specific in mind. More of a general enquiry really.
I don't suppose you have a mind to do anything else with GZDoom do you? As you may know, there is no longer any renderer-related development going on but there are a few things that people have asked about might be nice if they could be added. I have nothing specific in mind. More of a general enquiry really.

-
- Posts: 15
- Joined: Tue Sep 27, 2005 9:26
- Location: Vancouver, BC
- Contact:
Re: Oculus Rift support
It's definitely something you have to try first before it clicks. Everyone I know that was skeptical before trying it became complete converts after about 30 seconds. Even my wife likes it, and she doesn't play games at all
I'll probably try to record a video of it to throw up on Youtube soon. Static screenshots don't really convey how fun the head tracking is.
As for the other work, I don't think I'm willing to commit to any extra work specifically, mostly due to work (I'm working on rendering for FIFA XB1/PS4 now). But I'll try to pitch in here and there when I can, at least. It feels like I finally took a long enough break from it all, heh. Some work will come for free with the Rift work, anyway. I'll have to add a post effects framework to get the barrel distortion working, which means I can look at migrating some other things to be a proper post effect. The one that makes the most sense would be a colour cube, which the invulnerability effect would map nicely to. Then I could expose stuff like HSV adjustment via scripting so you can do colour grading. But I need to get the rest of this in a playable state first
Good to see you're still around, btw!

As for the other work, I don't think I'm willing to commit to any extra work specifically, mostly due to work (I'm working on rendering for FIFA XB1/PS4 now). But I'll try to pitch in here and there when I can, at least. It feels like I finally took a long enough break from it all, heh. Some work will come for free with the Rift work, anyway. I'll have to add a post effects framework to get the barrel distortion working, which means I can look at migrating some other things to be a proper post effect. The one that makes the most sense would be a colour cube, which the invulnerability effect would map nicely to. Then I could expose stuff like HSV adjustment via scripting so you can do colour grading. But I need to get the rest of this in a playable state first

Good to see you're still around, btw!
-
- Posts: 15
- Joined: Tue Sep 27, 2005 9:26
- Location: Vancouver, BC
- Contact:
Re: Oculus Rift support
Oh, http://zdoomgl.travelling-gunshow.com/GZDoom.rar (current WIP)
Since the release version doesn't link yet (some unresolved symbol from the OVR SDK that should exist, bleh), it's the debug version.
Anyway, some cvars:
vr_stereo_mode [0/1]: 1 = on.
vr_stereo_interpupillarydistance [float]: distance in meters between pupils. Read from OVR config but you can override it
vr_reset: reset the sensor if you find yourself not moving in the direction you're looking when looking straight ahead
It's probably best if you disable player sprites and the crosshair. Also, obviously pretty useless if you don't have a Rift
Since the release version doesn't link yet (some unresolved symbol from the OVR SDK that should exist, bleh), it's the debug version.
Anyway, some cvars:
vr_stereo_mode [0/1]: 1 = on.
vr_stereo_interpupillarydistance [float]: distance in meters between pupils. Read from OVR config but you can override it
vr_reset: reset the sensor if you find yourself not moving in the direction you're looking when looking straight ahead
It's probably best if you disable player sprites and the crosshair. Also, obviously pretty useless if you don't have a Rift

-
- Developer
- Posts: 31
- Joined: Fri Oct 11, 2013 0:49
Re: Oculus Rift support
That's great work timmie. I too am trying to work with gzdoom and the oculus rift. I tried your version out and I have a few questions:
How did you get the weapon in the center of both views like that? I'm struggling to get the HUD items to look OK in the side-by-side stereo mode.
It does not seem to track the Oculus Rift position. Do I need to do something to activate that input?
Have you made any progress rendering to an intermediate framebuffer, so you could apply the barrel distortion and chromatic aberration corrections? I hardly know where to begin with that.
My fork of the gzdoom source is at
https://github.com/cmbruns/gzdoom.git
So far all I have done is implement a few different stereoscopic modes. For example, anaglyph glasses with red/cyan or green/magenta lenses work quite well. I am just getting started with the gzdoom code base, and the remaining tasks are starting to enter some fairly advanced OpenGL territory.
The CVARS in my version are as follows:
st3d_mode [0,1,2,3,4,5,6]: 0 = off/mono
st3d_iod [float]: interocular distance in doom units
st3d_screendistance [float]: distance from player to hud, in doom units
st3d_swap [bool]: 0 = normal; 1 = swap eyes, to, say, view cross eyed.
Christopher


How did you get the weapon in the center of both views like that? I'm struggling to get the HUD items to look OK in the side-by-side stereo mode.
It does not seem to track the Oculus Rift position. Do I need to do something to activate that input?
Have you made any progress rendering to an intermediate framebuffer, so you could apply the barrel distortion and chromatic aberration corrections? I hardly know where to begin with that.
My fork of the gzdoom source is at
https://github.com/cmbruns/gzdoom.git
So far all I have done is implement a few different stereoscopic modes. For example, anaglyph glasses with red/cyan or green/magenta lenses work quite well. I am just getting started with the gzdoom code base, and the remaining tasks are starting to enter some fairly advanced OpenGL territory.
The CVARS in my version are as follows:
st3d_mode [0,1,2,3,4,5,6]: 0 = off/mono
st3d_iod [float]: interocular distance in doom units
st3d_screendistance [float]: distance from player to hud, in doom units
st3d_swap [bool]: 0 = normal; 1 = swap eyes, to, say, view cross eyed.
Christopher


-
- Developer
- Posts: 31
- Joined: Fri Oct 11, 2013 0:49
Re: Oculus Rift support
I have made some progress on the Oculus Rift front.
First, I realized that head tracking was not working for me with Timmie's demo because for some reason I had unplugged the USB cable from the Rift. I'm an idiot. "Is it plugged in?" would have been the correct technical support in this case *grins sheepishly*
I finally got the weapon sprite to appear in both views, by wrapping the FGLRenderer::EndDrawScene() method in my stereo 3d renderer.
Most importantly, I got the Oculus Rift image warping working. Now the view looks correct in the Oculus Rift, which is very exciting. It was easier than I thought it would be. But I have not applied the chromatic aberration correction yet.
The main thing I have yet to do, it to implement head tracking, like Timmie did.

Next I want to get a wireless game controller, and route the Oculus wire above my head, so I won't be tethered to the keyboard/mouse, and thus I can do all my turning, aiming, and looking by turning, aiming, and looking with my HEAD AND BODY. Doom might become excercise...
First, I realized that head tracking was not working for me with Timmie's demo because for some reason I had unplugged the USB cable from the Rift. I'm an idiot. "Is it plugged in?" would have been the correct technical support in this case *grins sheepishly*
I finally got the weapon sprite to appear in both views, by wrapping the FGLRenderer::EndDrawScene() method in my stereo 3d renderer.
Most importantly, I got the Oculus Rift image warping working. Now the view looks correct in the Oculus Rift, which is very exciting. It was easier than I thought it would be. But I have not applied the chromatic aberration correction yet.
The main thing I have yet to do, it to implement head tracking, like Timmie did.

Next I want to get a wireless game controller, and route the Oculus wire above my head, so I won't be tethered to the keyboard/mouse, and thus I can do all my turning, aiming, and looking by turning, aiming, and looking with my HEAD AND BODY. Doom might become excercise...
-
- Developer
- Posts: 31
- Joined: Fri Oct 11, 2013 0:49
Re: Oculus Rift support
My version of gzdoom for Oculus Rift is at last playable. I implemented head tracking, chromatic aberration correction, and tweaked the view geometry. Check it out:
http://rotatingpenguin.com/gz3doom/
The biggest remaining problem is that the status area, menus, and transition screens look terrible from within the Oculus Rift, because they span both eye views. Is there a screen implementation in gzdoom I can use to render all of those things into an OpenGL texture, that has a different size than the physical screen? I'm still a total noob in the gzdoom code (though I am beginning to understand more and more).
Christopher
http://rotatingpenguin.com/gz3doom/
The biggest remaining problem is that the status area, menus, and transition screens look terrible from within the Oculus Rift, because they span both eye views. Is there a screen implementation in gzdoom I can use to render all of those things into an OpenGL texture, that has a different size than the physical screen? I'm still a total noob in the gzdoom code (though I am beginning to understand more and more).
Christopher