Reverted Culling logic

- Just turned r_nocull back on again
- Add version info when playing demo
This commit is contained in:
Simon 2022-03-19 12:33:37 +00:00
parent 950f36de85
commit cb387417c1
10 changed files with 40 additions and 70 deletions

View file

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.ioq3quest" package="com.drbeef.ioq3quest"
android:installLocation="preferExternal" android:installLocation="preferExternal"
android:versionCode="37" android:versionCode="38"
android:versionName="0.26.0"> android:versionName="0.26.1">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" /> <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<uses-feature android:glEsVersion="0x00030001" /> <uses-feature android:glEsVersion="0x00030001" />
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>--> <!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->

View file

@ -515,9 +515,9 @@ Fixed fov at intermissions, otherwise account for fov variable and zooms.
static int CG_CalcFov( void ) { static int CG_CalcFov( void ) {
int contents; int contents;
int inwater; int inwater;
float phase; /* float phase;
float v; float v;
/* float x; float x;
float fov_x, fov_y; float fov_x, fov_y;
float zoomFov; float zoomFov;
float f; float f;
@ -572,8 +572,8 @@ static int CG_CalcFov( void ) {
// warp if underwater // warp if underwater
contents = CG_PointContents( cg.refdef.vieworg, -1 ); contents = CG_PointContents( cg.refdef.vieworg, -1 );
if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ){ if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ){
phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2; // phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2;
v = WAVE_AMPLITUDE * sin( phase ); // v = WAVE_AMPLITUDE * sin( phase );
// fov_x += v; // fov_x += v;
// fov_y -= v; // fov_y -= v;
inwater = qtrue; inwater = qtrue;
@ -592,8 +592,7 @@ static int CG_CalcFov( void ) {
cg.zoomSensitivity = cg.refdef.fov_y / 75.0; cg.zoomSensitivity = cg.refdef.fov_y / 75.0;
} }
//We don't do the under-water fov warping in VR return inwater;
return qfalse; //inwater;
} }

View file

@ -232,13 +232,14 @@ static void Main_MenuDraw( void ) {
UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color ); UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
} else { } else {
UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color ); UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
}
yPos += SMALLCHAR_HEIGHT; yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color ); UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT; yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color ); UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT; yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color ); UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color );
}
} }

View file

@ -47,11 +47,6 @@ static int R_MDRCullModel( mdrHeader_t *header, trRefEntity_t *ent ) {
mdrFrame_t *oldFrame, *newFrame; mdrFrame_t *oldFrame, *newFrame;
int i, frameSize; int i, frameSize;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
frameSize = (size_t)( &((mdrFrame_t *)0)->bones[ header->numBones ] ); frameSize = (size_t)( &((mdrFrame_t *)0)->bones[ header->numBones ] );
// compute frame pointers // compute frame pointers

View file

@ -1359,7 +1359,7 @@ void R_Register( void )
r_norefresh = ri.Cvar_Get ("r_norefresh", "0", CVAR_CHEAT); r_norefresh = ri.Cvar_Get ("r_norefresh", "0", CVAR_CHEAT);
r_drawentities = ri.Cvar_Get ("r_drawentities", "1", CVAR_CHEAT ); r_drawentities = ri.Cvar_Get ("r_drawentities", "1", CVAR_CHEAT );
r_ignore = ri.Cvar_Get( "r_ignore", "1", CVAR_CHEAT ); r_ignore = ri.Cvar_Get( "r_ignore", "1", CVAR_CHEAT );
r_nocull = ri.Cvar_Get ("r_nocull", "0", CVAR_CHEAT); r_nocull = ri.Cvar_Get ("r_nocull", "1", CVAR_CHEAT);
r_novis = ri.Cvar_Get ("r_novis", "0", CVAR_CHEAT); r_novis = ri.Cvar_Get ("r_novis", "0", CVAR_CHEAT);
r_showcluster = ri.Cvar_Get ("r_showcluster", "0", CVAR_CHEAT); r_showcluster = ri.Cvar_Get ("r_showcluster", "0", CVAR_CHEAT);
r_speeds = ri.Cvar_Get ("r_speeds", "0", CVAR_CHEAT); r_speeds = ri.Cvar_Get ("r_speeds", "0", CVAR_CHEAT);

View file

@ -207,7 +207,7 @@ int R_CullLocalBox(vec3_t localBounds[2]) {
int anyBack; int anyBack;
int front, back; int front, back;
if ( r_nocull->integer || vr_thirdPersonSpectator->integer ) { if ( r_nocull->integer ) {
return CULL_CLIP; return CULL_CLIP;
} }
@ -258,7 +258,7 @@ int R_CullLocalBox(vec3_t localBounds[2]) {
vec3_t v; vec3_t v;
vec3_t worldBounds[2]; vec3_t worldBounds[2];
if(r_nocull->integer || vr_thirdPersonSpectator->integer) if(r_nocull->integer )
{ {
return CULL_CLIP; return CULL_CLIP;
} }
@ -294,11 +294,6 @@ int R_CullBox(vec3_t worldBounds[2]) {
qboolean anyClip; qboolean anyClip;
int r, numPlanes; int r, numPlanes;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
numPlanes = (tr.viewParms.flags & VPF_FARPLANEFRUSTUM) ? 5 : 4; numPlanes = (tr.viewParms.flags & VPF_FARPLANEFRUSTUM) ? 5 : 4;
// check against frustum planes // check against frustum planes
@ -352,7 +347,7 @@ int R_CullPointAndRadiusEx( const vec3_t pt, float radius, const cplane_t* frust
const cplane_t *frust; const cplane_t *frust;
qboolean mightBeClipped = qfalse; qboolean mightBeClipped = qfalse;
if ( r_nocull->integer || vr_thirdPersonSpectator->integer) { if ( r_nocull->integer ) {
return CULL_CLIP; return CULL_CLIP;
} }
@ -1910,13 +1905,10 @@ void R_RenderPshadowMaps(const refdef_t *fd)
if (!radius) if (!radius)
continue; continue;
if (!vr_thirdPersonSpectator->integer)
{
// Cull entities that are behind the viewer by more than lightRadius // Cull entities that are behind the viewer by more than lightRadius
VectorSubtract(ent->e.origin, fd->vieworg, diff); VectorSubtract(ent->e.origin, fd->vieworg, diff);
if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value) if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value)
continue; continue;
}
memset(&shadow, 0, sizeof(shadow)); memset(&shadow, 0, sizeof(shadow));

View file

@ -139,10 +139,7 @@ void R_BoxSurfaces_r(mnode_t *node, vec3_t mins, vec3_t maxs, surfaceType_t **li
// do the tail recursion in a loop // do the tail recursion in a loop
while ( node->contents == -1 ) { while ( node->contents == -1 ) {
if (!vr_thirdPersonSpectator->integer)
s = BoxOnPlaneSide( mins, maxs, node->plane ); s = BoxOnPlaneSide( mins, maxs, node->plane );
else
s = 0;
if (s == 1) { if (s == 1) {
node = node->children[0]; node = node->children[0];
@ -172,10 +169,7 @@ void R_BoxSurfaces_r(mnode_t *node, vec3_t mins, vec3_t maxs, surfaceType_t **li
// extra check for surfaces to avoid list overflows // extra check for surfaces to avoid list overflows
else if (*(surf->data) == SF_FACE) { else if (*(surf->data) == SF_FACE) {
// the face plane should go through the box // the face plane should go through the box
if (!vr_thirdPersonSpectator->integer)
s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane ); s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane );
else
s = 0;
if (s == 1 || s == 2) { if (s == 1 || s == 2) {
*surfViewCount = tr.viewCount; *surfViewCount = tr.viewCount;

View file

@ -80,11 +80,6 @@ static int R_CullModel( mdvModel_t *model, trRefEntity_t *ent ) {
mdvFrame_t *oldFrame, *newFrame; mdvFrame_t *oldFrame, *newFrame;
int i; int i;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
// compute frame pointers // compute frame pointers
newFrame = model->frames + ent->e.frame; newFrame = model->frames + ent->e.frame;
oldFrame = model->frames + ent->e.oldframe; oldFrame = model->frames + ent->e.oldframe;
@ -329,8 +324,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
model = tr.currentModel->mdv[lod]; model = tr.currentModel->mdv[lod];
if (!vr_thirdPersonSpectator->integer)
{
// //
// cull the entire model if merged bounding box of both frames // cull the entire model if merged bounding box of both frames
// is outside the view frustum. // is outside the view frustum.
@ -340,7 +333,6 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
{ {
return; return;
} }
}
// //
// set up lighting now that we know we aren't culled // set up lighting now that we know we aren't culled

View file

@ -1263,8 +1263,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
ent->e.oldframe = 0; ent->e.oldframe = 0;
} }
if (!vr_thirdPersonSpectator->integer)
{
// //
// cull the entire model if merged bounding box of both frames // cull the entire model if merged bounding box of both frames
// is outside the view frustum. // is outside the view frustum.
@ -1274,7 +1272,6 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
{ {
return; return;
} }
}
// //
// set up lighting now that we know we aren't culled // set up lighting now that we know we aren't culled

View file

@ -32,7 +32,7 @@ added to the sorting list.
================ ================
*/ */
static qboolean R_CullSurface( msurface_t *surf ) { static qboolean R_CullSurface( msurface_t *surf ) {
if ( (r_nocull->integer || vr_thirdPersonSpectator->integer) || surf->cullinfo.type == CULLINFO_NONE) { if ( r_nocull->integer || surf->cullinfo.type == CULLINFO_NONE) {
return qfalse; return qfalse;
} }
@ -414,7 +414,7 @@ static void R_RecursiveWorldNode( mnode_t *node, uint32_t planeBits, uint32_t dl
// if the bounding volume is outside the frustum, nothing // if the bounding volume is outside the frustum, nothing
// inside can be visible OPTIMIZE: don't do this all the way to leafs? // inside can be visible OPTIMIZE: don't do this all the way to leafs?
if ( !r_nocull->integer && !vr_thirdPersonSpectator->integer ) { if ( !r_nocull->integer ) {
int r; int r;
if ( planeBits & 1 ) { if ( planeBits & 1 ) {