cancel
Showing results for 
Search instead for 
Did you mean: 

QUAKE [DK2 Support]

mindabuse
Explorer
I've just pushed up changes to my fork of QuakeSpasm-Rift.

v1.91: release post details
v1.90: release post details
v1.85: release post details
UPDATE: See this post on how to configure the Rift DK2 to work properly.

Look for the latest releases here:

https://github.com/jeremiah-sypult/Quakespasm-Rift/releases

This fork is using SDK v0.4.1 with a modified distortion shader to eliminate black smearing (when overdrive is enabled). Both DK1 and DK2 HMDs render with orientation and position tracking.

With your HMD configured in extended mode and as the primary display, fire up the game with:

quakespasm -vr


Configure settings in the Options > VR/HMD Settings menu, or check out the README for all of the cvars, as all the various HMD & Distortion flags can be toggled (multisampling, low persistence, dynamic prediction, vsync, timewarp, etc.).

https://github.com/jeremiah-sypult/Quakespasm-Rift/blob/master/README.md

You must provide the pak files. The free shareware (pak0.pak) as well as registered (pak0.pak + pak1.pak) files must go in a directory called 'id1' inside the folder that QuakeSpasm.app|exe resides in.

./Quake/QuakeSpasm.app|exe
./Quake/id1/pak0.pak

OS X: Since the DK2 appears as 1080x1920, you'll want to rotate it 90 degrees in System Preferences.app. I would suggest making the rift your primary display by dragging the white menu bar in the Arrangement settings to the rift. Then, cleverly find a way to launch the app full screen at 1920 x 1080 with the launcher. It's not the easiest thing to do, but it's not impossible....

Windows: The HMD must be in extended mode and configured as the primary display at the time of launching.

UPDATE: The game originally defaulted to a capped frame rate of 72 fps. To change it, you'll use:
host_maxfps xxx
where 'xxx' is a higher value (as high as you want, if you're interested in keeping vr_vsync disabled). The update is now 240.

There is also joystick/gamepad support. I've tested it with both PS3 and Xbox 360 controllers. The default 'joy_sensitivity' for aiming may be low, so make sure to experiment with different values. I've also added a vr_aimmode 6 which decouples the pitching of the weapon/view. Lastly, vr_deadzone set to 180 will entirely decouple the view + aiming (requested here), but I have no input controllers to test that kind of rig out.

Sounded like a few people were looking forward to this. I apologize I'm only been able to provide OS X binaries thus far, but I hope that folks on the other platforms might be able to help. Please fork on Github and feel free to hit me up with pull requests if any changes are needed.
88 REPLIES 88

jkostans
Honored Guest
"mindabuse" wrote:
The FOV is based on the viewing angle of the Oculus Rift and it can't be changed with any console commands at the moment. The scale in QUAKE is definitely unrealistic, so the fact that everything looks larger than it should is "normal". I attribute that to QUAKE being one of the first full-3D games on the market. If you use 'notarget' to disable the enemy AI from attacking you, you can see that ammo/health crates are like half the height of normal humanoid enemies. Holding the axe in front of enemies to examine the scale is also pretty amusing.


I did a little playing around and you're absolutely right about the FOV. There is however a huge discrepancy between what IPD I think feels right (~100mm), and what my IPD actually is (64mm). If I use the 100-120mm, the world seems more tangible. Square things look square when viewed at an angle etc. However this makes the viewpoint seem even lower to the floor, and the enemies seem tiny. All these years I never realized how out of whack the size of everything was. I guess you add stereo depth to the equation and the scaling flaws are exposed. Very interesting!

mindabuse
Explorer
"jkostans" wrote:
I did a little playing around and you're absolutely right about the FOV. There is however a huge discrepancy between what IPD I think feels right (~100mm), and what my IPD actually is (64mm). If I use the 100-120mm, the world seems more tangible. Square things look square when viewed at an angle etc. However this makes the viewpoint seem even lower to the floor, and the enemies seem tiny. All these years I never realized how out of whack the size of everything was. I guess you add stereo depth to the equation and the scaling flaws are exposed. Very interesting!


Playing with the IPD is definitely interesting **if you can handle it** (I'm guessing there are good reasons Oculus is pushing the safety warnings, etc., heh heh). I found that using intervals of my IPD (double, triple, quadruple, etc) were the "easiest" to adjust to. The higher the IPD, the "smaller" the world is, I'm assuming because you see a "wider angle" of things. You mentioned 100-120mm, and double of your 64mm IPD would be 128mm.

The original authors who did the DK1 support were using some "rougher" numbers for a couple things:


static const float player_height_units = 56;
static const float player_height_m = 1.75;

eye.offset = player_height_units * (vr_ipd.value/(player_height_m * 1000.0));


Early versions of my DK2 builds had an incorrect IPD calculation in translating QUAKE game/world units to real world units (meters/millimeters), but I'm pretty certain it is accurate and correct now:


// Wolfenstein 3D, DOOM and QUAKE use the same coordinate/unit system:
// 8 foot (96 inch) height wall == 64 pixel units
// 1.5 inches per pixel unit
// 1.0 pixel unit / 1.5 inch == 0.666666 pixel units per inch
// QuakeEd shows the *eye* height to be ~46 units high
// 46 units * 1.5 inch ratio == 69 inches / 12 inches == 5 foot 9 inch *eye level*

#define INCH_TO_METER (0.0254)
#define QUAKE_TO_METER (1.5 * INCH_TO_METER) // 0.0381 meters per quake pixel unit
#define METER_TO_QUAKE (1.0/QUAKE_TO_METER) // 26.24671916 quake pixel units per meter

static inline float QuakeToMeter(float q) { return q * QUAKE_TO_METER; }
static inline float MeterToQuake(float m) { return m * METER_TO_QUAKE; }


So, an IPD of 64mm would convert to ((64 * 0.001) * 26.24671916) == 1.6797900262 QUAKE units between eyes.

I tried to use multiple points of reference to verify between the original QuakeEd code, bits of the engine code, and manually counting the number of pixels from the floor to the "eye height" (with texture filtering disabled with GL_NEAREST because the default texture/pixel scale and world units were 1:1).

I can't nail down where I found the reference to the Wolf 3D/DOOM/QUAKE units, but it was something that John Carmack had said (that the Wolf3D wall height was supposed to be the "standard" 8-foot wall height, and the artwork was 64x64 pixels). It was in either a .plan file, blog, interview or tweet somewhere in the past.

If I messed up any part of the calculation I'd love to know.

mindabuse
Explorer
"mindabuse" wrote:
I can't nail down where I found the reference to the Wolf 3D/DOOM/QUAKE units, but it was something that John Carmack had said (that the Wolf3D wall height was supposed to be the "standard" 8-foot wall height, and the artwork was 64x64 pixels). It was in either a .plan file, blog, interview or tweet somewhere in the past.


The fact that I didn't have my reference documented was bothering me again, so I did a little searching again. I didn't find the posting I thought I remembered from John Carmack, but I did find this bit from the QUAKE III ARENA Shader Manual, section 2.4.7 Measurements:

http://icculus.org/gtkradiant/documentation/Q3AShader_Manual/ch01/pg1_1.htm


2.4.7 Measurements
Game unit: A game unit is used by deformations to specify sizes relative to the world. Game units are
the same scale we have had since way back in the Wolfenstein days – 8 units equals one foot.


So that lines up with 8 units/one foot x 8 feet = 64 units.

jkostans
Honored Guest
Interesting stuff. I didn't know they kept the same unit lengths from Wolfenstein, that's pretty awesome. So the quake guy is 5'9", and I'm 5'10". When I crouched down, the floor was indeed in the right physical position using 64mm, and movement feels 1:1. Your calculations seem spot on, great job! I'm amazed at the size of the pixels in real world units. I never thought I would learn so much about a game I started playing when I was 13.

RosevilleReaper
Honored Guest
Still love quake, still love quake on my dk2. Really wish I could add some graphics mods tho 😞

Hammer09
Honored Guest
Stupid question here, so would like some guidance please.

Running Bilago's VR Game manager, is there anyway I can get this to launch on my rift onto the secondary screen.

I use teh Extend Desktop to the HMD option.

mindabuse
Explorer
"Hammer09" wrote:
Question here, so would like some guidance please.

Running Bilago's VR Game manager, is there anyway I can get this to launch on my rift onto the secondary screen.

I use teh Extend Desktop to the HMD option.


I'm not sure if QUAKE (or other OpenGL/SDL v1-based games) are able to run on the HMD when configured as a secondary screen, unfortunately. The HMD has to be set up as the primary display.

I intend to push out a new release/update with the latest Oculus VR SDK and QuakeSpasm versions in the near future. QuakeSpasm has been updated to use SDL2, but I'm not sure if it will run full-screen on a secondary display or not.

Hope this helps!

Hammer09
Honored Guest
Hi There,

This helps very much - firstly and most importantly, thank you for what you have done here. I loved Quake and the hope to be able to play it on my Rift is just simply a dream come true. Loved that game.

I will setup my device as a Primary when back home, simply my configuration is not fit for purpose - but it's no big deal to make the adjustment.

Thanks for your help with this.

TWhite
Explorer
I remember hearing something about a Darkplaces VR port for Quake. Any word on that? As that is what I am waiting for to experience Quake 1 in the Rift.

The same thing needs to happen to Quake 2 with Berserker mod.
CPU: i7 3770k 4.6Ghz GPU: EVGA GTX 780

jrd3d
Explorer
"TWhite" wrote:
I remember hearing something about a Darkplaces VR port for Quake. Any word on that? As that is what I am waiting for to experience Quake 1 in the Rift.

The same thing needs to happen to Quake 2 with Berserker mod.


https://forums.oculus.com/viewtopic.php?f=26&t=13606
this is a thread I have been following, but haven't seen anything mentioned in quite a while 😞