Page 1 of 5

Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 8:27 pm
by densohax
Hello,

I've just registered to let you know I've modded ioquake3 to support the rift.
Still need to implement Head Tracking and clean up a bit..

This is the result so far ...


Can't wait to get access to the dev kit and obviously the HMD!!! :woot

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 8:40 pm
by greenknight
Wow that is great news, thanks.

I bought ut3 recently to play it in VR, but from what I hear many people feel quite sick inside UT3 and that is probably true for quake also.

OTOH, I've played games like this for a long time, so maybe it won't be so bad. Something tells me, probably not. Anyone on the forums with their thoughts on quake/doom/UT3 type games and the rift causing nausea? A select few might have an answer, but I think they are not talking due to requests from Palmer et. al. to keep reviews of the hardware under wraps. I am guessing that is because the oculus rift hmd is not 'officially' out yet. And of course it is just a dev kit and SDK apparently isn't ready yet.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 8:50 pm
by cybereality
Great work man!

Not your fault, but the gun is rendering behind the floor, which is very strange. This is a problem with playing most FPS games in 3D.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:01 pm
by densohax
Thanks guys! ;)

Cyber, how do you determine it is behind the floor, do you have a way to view the image in stereoscopy?
I can cross my eyes tho, but I can't determine if it's rendered inaccurately yet..

Oh btw, I was crouching in this screenshot, maybe that's why the gun seem to be very near the floor?

Also, I hacked the stereoscopic separation feature that was already in quake3 (anaglyph) and added FBOs and GLSL to quake3. So it might not be right for HMD devices but work with anaglyph?


About feeling sick.. I agree that Quake3 being very fast paced could create sickness, we'll see for sure with the rift! I can test cross eyed but that creates sickness in itself! :lol:

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:10 pm
by geekmaster
densohax wrote:Thanks guys! ;)

Cyber, how do you determine it is behind the floor, do you have a way to view the image in stereoscopy?
I can cross my eyes tho, but I can't determine if it's rendered inaccurately yet..

Oh btw, I was crouching in this screenshot, maybe that's why the gun seem to be very near the floor?

Also, I hacked the stereoscopic separation feature that was already in quake3 (anaglyph) and added FBOs and GLSL to quake3. So it might not be right for HMD devices but work with anaglyph?


About feeling sick.. I agree that Quake3 being very fast paced could create sickness, we'll see for sure with the rift! I can test cross eyed but that creates sickness in itself! :lol:
Most browser let you change the size by holding the control key while using the mouse scroll wheel. Shrink the images down so they look like a window in your screen, and look through it at the 3D stuff behind the window. If you can do crosseye, you can already do focus and convergence separately, so just shrink it enough to see in 3D.

Otherwise, save the image, and convert it to cross-eye with cut and paste...

The gun IS behind the floor when viewed in 3D.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:16 pm
by densohax
I think I see what you mean geekmaster.. But to me it looks like the gun is at the same level as the HUD?
I'm don't have much experience with stereoscopy, I must admit! I used shutter glasses and that's about it..


Here's another screenshot, separation at 32 instead of 16 :

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:29 pm
by geekmaster
In this image, the left wall with rivets is at window level (or perhaps just a little outside the window). Everything else is behind it (even the score is a little behind it). The gun is far behind the window surface. Nothing should ever extend out from the window while cropped by the window frame (a classic "window violation" error).

Here is an example, where I did a quick copy/paste to move the gun about where it should be. Notice an annoying "window violation" error on the annoying red thing to the left of the gun, which is well outside the window boundary (viewer side of the screen). That annoying red thing should be removed. What is it anyway?

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:36 pm
by cybereality
The images are parallel, you can view them in 3D by free-viewing. I've gotten pretty good at this, but I still have to shrink the image (or move away from my monitor) to do it. With cross-eye I can do it with full-screen images, parallel is harder.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:37 pm
by densohax
Hmmmm...

Does that mean that the perspective matrix is only translated instead of being rotated and translated?

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:43 pm
by android78
Just regarding free view of parallel images, if you're short sighted like me, take your glasses off, it's easy to view like that so long as the images are smaller then about 5cm wide. Practice makes perfect.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:44 pm
by cybereality
No. You're not doing anything wrong. It just the way developers draw the gun directly onto the screen and not as part of the main world.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:46 pm
by geekmaster
cybereality wrote:The images are parallel, you can view them in 3D by free-viewing. I've gotten pretty good at this, but I still have to shrink the image (or move away from my monitor) to do it. With cross-eye I can do it with full-screen images, parallel is harder.
Yes, like I said, adjust the size of the image on the web page with the mouse scroll wheel, while holding the CTRL key down (for most browsers).

If you shrink it so the image centers match your IPD (or even a bit smaller), it should be like looking through a glass window in your web page, at a 3D scale model behind it. Cross-eye views can be just about any size. And I remove my glasses and put my face closer to my monitor when viewing wide-eye 3D image pairs.

In my editted images above, I was just showing where the gun SHOULD be in relation to the window and rendered scene. In the original view, it almost looks like a boat sitting down in a trench or something...

Gun placement is important for games designed FOR the Rift, and they should be just behind the viewing window. The window boundaries are less important with an extremely wide FoV though, but at least the gun should not be BEHIND objects in the scene.

If you cannot control gun placement, then you need to make sure EVERYTHING in the scene stays deeper than the gun (unlike this image pair).

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:51 pm
by 2EyeGuy
densohax wrote:Cyber, how do you determine it is behind the floor, do you have a way to view the image in stereoscopy?
I can cross my eyes tho, but I can't determine if it's rendered inaccurately yet..
Don't cross your eyes, it's not a cross-eyed image. Rift screenshots are always viewed parallel. You need to look through the screen so your eyes converge behind the screen, and the image needs to be small enough for that to work. Unless some annoying person was trying to be "helpful" by converting it to cross-eyed before posting, which thankfully isn't the case here.
geekmaster wrote:In this image, the left wall with rivets is at window level (or perhaps just a little outside the window). Everything else is behind it (even the score is a little behind it). The gun is far behind the window surface. Nothing should ever extend out from the window while cropped by the window frame (a classic "window violation" error).
None of that's true. They are distinctly a bit in front of the window. And on the Rift you don't care whether things are cropped by the window frame... because there is no window frame. The Rift has a super large FOV so it's not like looking through a small window. I'm not even sure you can see some of the edges of the screen. And people want things rendered with 1 to 1 geometric accuracy for VR on the Rift, so they can get the real-life sense of scale and presence, not with hacks to stop things being occluded by the screen edges you can hardly even see.

The 7" rift is not 100% overlap, so it has the camera centers not in the center of the screen-halves. Also you need to work out what game units map to what units in real life, and try to render things realistically, or on the Rift things will be obviously the wrong sizes.

BTW, I added VR920 head-tracking to ioquake 3, years ago (for World Of Padman), although I don't remember where I put it since I got annoyed with the lack of gratitude from some websites. I'll see if I can find it for you. It's not that hard to do though (which is why I started with that rather than adding 3D support).

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:54 pm
by geekmaster
2EyeGuy wrote:... None of that's true. They are distinctly a bit in front of the window. And on the Rift you don't care whether things are cropped by the window frame... because there is no window frame. The Rift has a super large FOV so it's not like looking through a small window. I'm not even sure you can see some of the edges of the screen. And people want things rendered with 1 to 1 geometric accuracy for VR on the Rift, so they can get the real-life sense of scale and presence, not with hacks to stop things being occluded by the screen edges you can hardly even see.

The 7" rift is not 100% overlap, so it has the camera centers not in the center of the screen-halves. Also you need to work out what game units map to what units in real life, and try to render things realistically, or on the Rift things will be obviously the wrong sizes.
Yeah, I was talking about viewing onscreen image pairs as shown on this web page. I also mentioned that window boundaries and violation errors are less important for wide FoV like the Rift (where there essentially are NO window boundaries to violate).

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:56 pm
by densohax
Ahhhhhhh!

Ok so the trick is to "parallel" your eyes.. I get it ..
I think I see what you mean by the gun being behind everything, it kind of stop the illusion from working..

I've looked at the quake port on this forum and his screenshots look far much better than the stereo separation in ioquake3..
I honestly have great difficulty judging what is acceptable/good or perfect.. I guess I'll need my rift to perfect it!


2EyeGuy, thanks a lot, that gives me something to work on before getting my hands on the rift! And yeah if you find the headtracking source, it would be very kind of you!

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 9:59 pm
by geekmaster
Was that red thing on the image supposed to be an icon indicating armor or something?

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:03 pm
by densohax
geekmaster wrote:
cybereality wrote: In my editted images above, I was just showing where the gun SHOULD be

Gun placement is important for games designed FOR the Rift, and they should be just behind the viewing window. The window boundaries are less important with an extremely wide FoV though, but at least the gun should not be BEHIND objects in the scene.

If you cannot control gun placement, then you need to make sure EVERYTHING in the scene stays deeper than the gun (unlike this image pair).
I compared my old screenshot with your modified image, I see a very subtle difference however, the gun seem to be behind the riveted wall with your modified picture compared to the original where I see it as being at equal depth to the riveted wall..

Maybe I don't see in stereo after all...

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:04 pm
by densohax
geekmaster wrote:Was that red thing on the image supposed to be an icon indicating armor or something?

No it's the player head model, it's part of the normal HUD.

I see it "fuzzing" around when free viewing the image.

The HUD have no depth information, maybe that's why everything looks strange to you, I'll take a screenshot without it to compare.

**Edit: Please note that I'm still not finished with the rendering and that yes right eye is lagging 1 frame behind at the moment, which will be fixed soon enough..

Screenshot:

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:11 pm
by phil
Hi,

I think it would also be worth giving the environment-mapped surfaces some attention. If you're able to calculate those effects correctly for each eye's separate viewpoint, the result will really look like reflections rather than a layer of sliding paint.

The stereo drivers (and even some native stereo games) that work by displacing vertices post-projection are disappointing because they prevent sheen effects from looking the way they should in each eye. That's why ideally the stereo should be applied earlier, in the view & projection matrices.

Cheers,
phil

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:14 pm
by 2EyeGuy
cybereality wrote:Great work man!

Not your fault, but the gun is rendering behind the floor, which is very strange. This is a problem with playing most FPS games in 3D.
That's John Carmack's fault (but since he invented FPS games where you see your gun, I'll forgive him). He regretted it later when he was adding 3D and Rift support to Doom 3 BFG.

The gun is usually rendered with a completely different FOV than the rest of the scene, and probably a different scale and position too. It's also probably rendered with a cleared Z-Buffer after everything else has been rendered. For the Rift, you want to find the code for rendering the gun, get rid of the Z-Buffer clearing and view/projection matrix changing, and instead render it at a realistic size and position. If it gets clipped by the near clipping plane, you might need to make the near clipping plane closer, or go back to clearing the Z Buffer and rendering with only the clipping planes changed. Once you have that working, you might want to make the gun change it's position when you walk up close to a wall or object so that it doesn't penetrate the wall. In real life you'd raise or lower the gun, or let it go back on the right side of your body, when you got near a wall.

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:20 pm
by densohax
Thanks for the suggestion, I'll dig a bit more in the source to find where I can enhance the display, but keep in mind that this is an old game and I didn't apply a hires texture pack yet.. It's also based on old dinosaur GL code with homemade shaders, however it's a masterpiece since it's made by John Carmack and is my favorite game; I only added a post processing GLSL stage as a first step. This is at best 2-3 days of work and I don't know the entire engine yet.

Also, I think my feeble eyes are not good enough yet at free viewing, so I fail at seeing the subtle issues, I think I'll get a better understanding as soon as I have my devkit! .. But that won't make it ship here faster I'm afraid... ;)
For the Rift, you want to find the code for rendering the gun, get rid of the Z-Buffer clearing and view/projection matrix changing,
Will certainly do that! Very good suggestions, keep them coming!

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:22 pm
by densohax
2EyeGuy wrote:
That's John Carmack's fault (but since he invented FPS games where you see your gun, I'll forgive him). He regretted it later when he was adding 3D and Rift support to Doom 3 BFG.
Yeah I was just wondering why he didn't put effort in integrating the Rift in Quake3, that could explain why..

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 10:39 pm
by Neil
Hi Guys,

Just a heads-up that I got this on the front page. Good stuff!

Regards,
Neil

Re: Quake3 - Ready for VR

Posted: Sun Mar 10, 2013 11:02 pm
by vietNOM
Yesssssss! :D glad someone is working on this, the thought of hitting that jumppad in q3dm17 already makes me feel a lil queasy but should be great!

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 12:27 am
by Owen
There is an old Q3 mod called Viz that gives you full body awareness, might solve these issues.

http://www.gamefront.com/files/3721/Viz_Mod_1_4_1_

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 7:49 am
by geekmaster
Viz mod looks useful.

Regarding the above discussion on "which side of the window" to render objects, here is a useful document.
http://scien.stanford.edu/pages/confere ... ngYuan.pdf

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 3:40 pm
by Owen
All of those ideas for comfortable viewing pretty much go out the window for an HMD though, articles like that assume a 3D monitor which has vastly different physical constraints and more variables.

The best viewing method for an HMD is almost certainly the phsyically correct one, as anything else produces discrepancies between how you expect your eyes to work and what you actually see, contributing to simulator sickness and harming immersion. Unlike with 3D monitors there is a clear right answer.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 3:55 pm
by Mystify
Owen wrote:The best viewing method for an HMD is almost certainly the phsyically correct one, as anything else produces discrepancies between how you expect your eyes to work and what you actually see, contributing to simulator sickness and harming immersion. Unlike with 3D monitors there is a clear right answer.
This. HMDs get around a lot of the issues normally present in 3D by allowing it to have a 1:1 correspondence to the game world. You don't have to worry about how much of your 3D effect is coming out of the screen, you just position objects in the world. You don't have to worry about where the horizon should be, you just place it normally and people will look where they naturally would.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 4:20 pm
by Lark
If you get your oculus before you fix it you could turn off the gun with the cvar cg_drawGun 0

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 4:21 pm
by yautjacetanu
geekmaster wrote:In this image, the left wall with rivets is at window level (or perhaps just a little outside the window). Everything else is behind it (even the score is a little behind it). The gun is far behind the window surface. Nothing should ever extend out from the window while cropped by the window frame (a classic "window violation" error).

Here is an example, where I did a quick copy/paste to move the gun about where it should be. Notice an annoying "window violation" error on the annoying red thing to the left of the gun, which is well outside the window boundary (viewer side of the screen). That annoying red thing should be removed. What is it anyway?
This is the first time I've been able to see one of these images as a 3d image!!!! (by sort of crossing my eyes I think). Thats awesome!!! Thanks!

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 4:25 pm
by mattyeatsmatts
yautjacetanu wrote:
geekmaster wrote:In this image, the left wall with rivets is at window level (or perhaps just a little outside the window). Everything else is behind it (even the score is a little behind it). The gun is far behind the window surface. Nothing should ever extend out from the window while cropped by the window frame (a classic "window violation" error).

Here is an example, where I did a quick copy/paste to move the gun about where it should be. Notice an annoying "window violation" error on the annoying red thing to the left of the gun, which is well outside the window boundary (viewer side of the screen). That annoying red thing should be removed. What is it anyway?
This is the first time I've been able to see one of these images as a 3d image!!!! (by sort of crossing my eyes I think). Thats awesome!!! Thanks!
I don't get it,is it like doing those "Magic Eye" picture things or is it a different technique.

EDIT: holy crap! it is like a magic eye that is pretty cool. just blew my mind

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 4:41 pm
by sth
Owen wrote:There is an old Q3 mod called Viz that gives you full body awareness, might solve these issues.

http://www.gamefront.com/files/3721/Viz_Mod_1_4_1_
Thanks for the link! Unfortunately, viz requires an old version of Quake 3 (< 1.17) to run, but I just set up a 1.16n installation and tried it.

This viz mod itself seems to be a modification of the third-person camera code already present in Q3A.
You set cg_thirdPerson to -1, which causes the mod to render the player model (without the head submodel, as far as I can see) and attach the camera somewhere relative to the head tag (the attachment point of the head submodel). The view model of the weapon is also gone (you see the "world" model of the gun as it is attached to the player model).

The problem that results is that the the camera moves according to the model animations. This is very disorienting even without VR.

A quick fix for this would be to limit model animations to 1 frame (e.g. the first frame of the idle animation) in the model's animation.cfg file. This would effectively kill the animations but at least it wouldn't make you throw up. ;)
There should be better ways to handle this, though. Several come to mind, but I'd have to play around with it to see what works well.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 5:06 pm
by Owen
I think that in general the only solution is more realistic character animations. You can't really have body awareness if your view doesn't move with your body.

Excessive head and upper body motion is an artistic choice usually done to cover up the simplicity of most animation systems. Real human motions are pretty subtle, even at a full sprint, but highly variable.

But I think we can't just say "no head bob", its necessary to have the amount of motion that the player expects based on how they are directing the character to move. Its when that motion disagrees with our expectations that we get the most severe sim sickness.

Good article on the subject:
http://www.gamasutra.com/view/news/1780 ... T5j8NF4Yf8

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 5:54 pm
by sth
More realistic character animations would be great, but I don't think the goal here is to remake a game from 1999 into the perfect VR experience of 2013 (if anyone wants to do that – I'd love to play it!). It's more about what is possible with what is there. I don't think it will be possible to achieve good body awareness in the game, but you probably won't have to move around without any feet. ;)

Anyway, I think the pragmatic way forward would be simply to integrate the camera using the official Rift SDK when it's out (complete with head/neck model etc.) and then see how the player model can be integrated into all of this.

Owen wrote:But I think we can't just say "no head bob", its necessary to have the amount of motion that the player expects based on how they are directing the character to move.
Hmmm... I'm not sure about this, but I also can't test it since I don't have my HMD yet.
My initial guess would be that any kind of subtle head movement that is not initiated by your own body will probably cause motion sickness or will at least be disorienting, but maybe someone from Oculus can share their experiences with this.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 6:45 pm
by Owen
I really think people are just going to have to get used to it. Involuntary motions are unavoidable in any game where you have varying terrain, collision detection, gravity, etc.

And in any case unless you are using GVS or are actually walking around in a large play area your vision won't correlate to your inner ear at all. All we can do is match movement with player intention in a way that can be anticipated.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 7:04 pm
by densohax
Hey guys,

Actually bobbing can be easily turned off.. Q3 has a bunch of vars that are easily tweakable in the console..

I will try to render the body of the player eventually, now I've just made a quick pass to clean up the rendering..
I also played around with stereoseparation and zprojection plane...

I attach a screenshot, please tell me if you see an amelioration compared to the original.

Oh also, please note that I will fork ioquake3 and name it vrquake3, because it's not going to be compatible with ioquake3 anymore, since changing gun configuration or some rendering is considered cheating by the servers.. So I guess we'll need to play against other VR users..

** EDIT : Take a look at the next screenshot, it actually enables the depth for the gun (picture called gunwithdepthvrq3.png)

gunwithdepthvrq3.png is the new gun with depth enabled, separation at 8. (8 units == 1 foot in quake I think)
vrq3gun.png is just the old gun shifted to the right. With separation at 32.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 7:28 pm
by geekmaster
densohax wrote:... I attach a screenshot, please tell me if you see an amelioration compared to the original. ...
** EDIT : Take a look at the next screenshot, it actually enables the depth for the gun (picture called gunwithdepthvrq3.png)

gunwithdepthvrq3.png is the new gun with depth enabled, separation at 8. (8 units == 1 foot in quake I think)
vrq3gun.png is just the old gun shifted to the right. With separation at 32.
Both screenshots are a HUGE improvement over previous screenshots, especially gun rendering. Thanks.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 7:52 pm
by mattyeatsmatts
looks good to me, well the gun doenst pop as much as i want it too but still looks great

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 7:59 pm
by geekmaster
mattyeatsmatts wrote:looks good to me, well the gun doenst pop as much as i want it too but still looks great
Actually, I think the gun IS in the right place for "shooting from the hip" (with laser sights or tracer rounds). When looking through the gunsight or scope (as in other games), the gun should be a lot closer to the face, like in the modified image I attached to my post earlier in this thread. But displaying HUD text that hovers behind the gun is a "window violation error" (where the text IS the window), and is very annoying and distracting. The gun should be kept behind any HUD displays, as shown in these recent images. Perhaps moving the HUD image closer to the face could allow room for a closer gun.

Re: Quake3 - Ready for VR

Posted: Mon Mar 11, 2013 8:07 pm
by densohax
geekmaster wrote:Having HUD text behind the gun is a "window violate" (where the text IS the window), and is very annoying and distracting.

Oh I actually will work on this, I'm thinking about how I could do it, I have a few ideas, like removing the hud altogether, alpha blend it on top of everything, render the hud on the middle of the projection plane, render a part of the hud on the gun etc..


Some screenshot teaser with hi res texture pack and linear filtering...