Stereo
This commit is contained in:
parent
f655ae2163
commit
f983f1378d
|
@ -93,8 +93,8 @@ PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
|
|||
//Let's go to the maximum!
|
||||
int CPU_LEVEL = 4;
|
||||
int GPU_LEVEL = 4;
|
||||
int NUM_MULTI_SAMPLES = 4;
|
||||
float SS_MULTIPLIER = 1.25f;
|
||||
int NUM_MULTI_SAMPLES = 1;
|
||||
float SS_MULTIPLIER = 1.0f;
|
||||
|
||||
jclass clazz;
|
||||
|
||||
|
|
|
@ -556,7 +556,7 @@ ovrLayerCylinder2 BuildCylinderLayer( ovrRenderer * cylinderRenderer,
|
|||
const float density = 4500.0f;
|
||||
const float rotateYaw = 0.0f;
|
||||
const float radius = 4.0f;
|
||||
const ovrVector3f translation = { 0.0f, playerHeight, -2.5f };
|
||||
const ovrVector3f translation = { 0.0f, 0.0f, -2.5f };
|
||||
|
||||
ovrMatrix4f cylinderTransform =
|
||||
CylinderModelMatrix( textureWidth, textureHeight, translation,
|
||||
|
|
|
@ -136,7 +136,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
offhandangles[YAW] += (doomYawDegrees - hmdorientation[YAW]);
|
||||
|
||||
if (vr_walkdirection == 0) {
|
||||
controllerYawHeading = -doomYawDegrees + offhandangles[YAW];
|
||||
controllerYawHeading = offhandangles[YAW] - hmdorientation[YAW];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
|
||||
vec2_t v;
|
||||
rotateAboutOrigin(-positionDeltaThisFrame[0] * vr_positional_factor,
|
||||
positionDeltaThisFrame[2] * vr_positional_factor, - hmdorientation[YAW], v);
|
||||
positionDeltaThisFrame[2] * vr_positional_factor, hmdorientation[YAW], v);
|
||||
positional_movementSideways = v[0];
|
||||
positional_movementForward = v[1];
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ EXTERN_CVAR(Float, vr_snapTurn);
|
|||
EXTERN_CVAR(Float, vr_ipd);
|
||||
|
||||
double P_XYMovement(AActor *mo, DVector2 scroll);
|
||||
extern "C" void VR_GetMove( float *joy_forward, float *joy_side, float *hmd_forward, float *hmd_side, float *up, float *yaw, float *pitch, float *roll );
|
||||
|
||||
|
||||
namespace s3d
|
||||
|
@ -112,12 +113,31 @@ namespace s3d
|
|||
doomYawDegrees = yaw;
|
||||
outViewShift[0] = outViewShift[1] = outViewShift[2] = 0;
|
||||
|
||||
// Pitch and Roll are identical between OpenVR and Doom worlds.
|
||||
// But yaw can differ, depending on starting state, and controller movement.
|
||||
float doomYawDegrees = yaw;
|
||||
float vrYawDegrees = hmdorientation[YAW];
|
||||
deltaYawDegrees = doomYawDegrees - vrYawDegrees;
|
||||
while (deltaYawDegrees > 180)
|
||||
deltaYawDegrees -= 360;
|
||||
while (deltaYawDegrees < -180)
|
||||
deltaYawDegrees += 360;
|
||||
|
||||
VSMatrix shiftMat;
|
||||
shiftMat.loadIdentity();
|
||||
|
||||
shiftMat.rotate(GLRenderer->mAngles.Roll.Degrees, 0, 0, 1);
|
||||
shiftMat.rotate(GLRenderer->mAngles.Pitch.Degrees, 1, 0, 0);
|
||||
shiftMat.rotate(GLRenderer->mAngles.Yaw.Degrees, 0, 1, 0);
|
||||
shiftMat.rotate(deltaYawDegrees, 0, 1, 0);
|
||||
double pixelstretch = level.info ? level.info->pixelstretch : 1.2;
|
||||
shiftMat.scale(pixelstretch, pixelstretch, 1.0);
|
||||
// permute axes
|
||||
float permute[] = { // Convert from OpenVR to Doom axis convention, including mirror inversion
|
||||
-1, 0, 0, 0, // X-right in VR -> X-left in Doom
|
||||
0, 0, 1, 0, // Z-backward in VR -> Y-backward in Doom
|
||||
0, 1, 0, 0, // Y-up in VR -> Z-up in Doom
|
||||
0, 0, 0, 1};
|
||||
shiftMat.multMatrix(permute);
|
||||
|
||||
double mult = eye == 0 ? -1.0 : 1.0;
|
||||
|
||||
|
@ -131,7 +151,7 @@ namespace s3d
|
|||
// We want to align those two heights here
|
||||
const player_t & player = players[consoleplayer];
|
||||
double vh = player.viewheight; // Doom thinks this is where you are
|
||||
double hh = (hmdPosition[2] - vr_floor_offset) * vr_vunits_per_meter; // HMD is actually here
|
||||
double hh = (hmdPosition[1] - vr_floor_offset) * vr_vunits_per_meter; // HMD is actually here
|
||||
eyeOffset[2] += hh - vh;
|
||||
|
||||
outViewShift[0] = eyeOffset[0];
|
||||
|
@ -370,8 +390,6 @@ namespace s3d
|
|||
return int(m);
|
||||
}
|
||||
|
||||
extern "C" void VR_GetMove( float *joy_forward, float *joy_side, float *hmd_forward, float *hmd_side, float *up, float *yaw, float *pitch, float *roll );
|
||||
|
||||
/* virtual */
|
||||
void OculusQuestMode::SetUp() const
|
||||
{
|
||||
|
|
|
@ -222,10 +222,7 @@ extern int camtexcount;
|
|||
|
||||
void OpenGLFrameBuffer::Swap()
|
||||
{
|
||||
//glFinish();
|
||||
|
||||
|
||||
glFlush();
|
||||
glFinish();
|
||||
|
||||
/* bool swapbefore = gl_finishbeforeswap && camtexcount == 0;
|
||||
Finish.Reset();
|
||||
|
|
|
@ -1 +1 @@
|
|||
qzdoom --supersampling 1.2 -iwad wads/DOOM.WAD
|
||||
qzdoom -iwad wads/DOOM.WAD
|
Loading…
Reference in New Issue