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"
package="com.drbeef.ioq3quest"
android:installLocation="preferExternal"
android:versionCode="37"
android:versionName="0.26.0">
android:versionCode="38"
android:versionName="0.26.1">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<uses-feature android:glEsVersion="0x00030001" />
<!-- <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 ) {
int contents;
int inwater;
float phase;
/* float phase;
float v;
/* float x;
float x;
float fov_x, fov_y;
float zoomFov;
float f;
@ -572,8 +572,8 @@ static int CG_CalcFov( void ) {
// warp if underwater
contents = CG_PointContents( cg.refdef.vieworg, -1 );
if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ){
phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2;
v = WAVE_AMPLITUDE * sin( phase );
// phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2;
// v = WAVE_AMPLITUDE * sin( phase );
// fov_x += v;
// fov_y -= v;
inwater = qtrue;
@ -592,8 +592,7 @@ static int CG_CalcFov( void ) {
cg.zoomSensitivity = cg.refdef.fov_y / 75.0;
}
//We don't do the under-water fov warping in VR
return qfalse; //inwater;
return 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 );
} else {
UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color );
}
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
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;
int i, frameSize;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
frameSize = (size_t)( &((mdrFrame_t *)0)->bones[ header->numBones ] );
// compute frame pointers

View file

@ -1359,7 +1359,7 @@ void R_Register( void )
r_norefresh = ri.Cvar_Get ("r_norefresh", "0", CVAR_CHEAT);
r_drawentities = ri.Cvar_Get ("r_drawentities", "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_showcluster = ri.Cvar_Get ("r_showcluster", "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 front, back;
if ( r_nocull->integer || vr_thirdPersonSpectator->integer ) {
if ( r_nocull->integer ) {
return CULL_CLIP;
}
@ -258,7 +258,7 @@ int R_CullLocalBox(vec3_t localBounds[2]) {
vec3_t v;
vec3_t worldBounds[2];
if(r_nocull->integer || vr_thirdPersonSpectator->integer)
if(r_nocull->integer )
{
return CULL_CLIP;
}
@ -294,11 +294,6 @@ int R_CullBox(vec3_t worldBounds[2]) {
qboolean anyClip;
int r, numPlanes;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
numPlanes = (tr.viewParms.flags & VPF_FARPLANEFRUSTUM) ? 5 : 4;
// 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;
qboolean mightBeClipped = qfalse;
if ( r_nocull->integer || vr_thirdPersonSpectator->integer) {
if ( r_nocull->integer ) {
return CULL_CLIP;
}
@ -1910,13 +1905,10 @@ void R_RenderPshadowMaps(const refdef_t *fd)
if (!radius)
continue;
if (!vr_thirdPersonSpectator->integer)
{
// Cull entities that are behind the viewer by more than lightRadius
VectorSubtract(ent->e.origin, fd->vieworg, diff);
if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value)
continue;
}
// Cull entities that are behind the viewer by more than lightRadius
VectorSubtract(ent->e.origin, fd->vieworg, diff);
if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value)
continue;
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
while ( node->contents == -1 ) {
if (!vr_thirdPersonSpectator->integer)
s = BoxOnPlaneSide( mins, maxs, node->plane );
else
s = 0;
s = BoxOnPlaneSide( mins, maxs, node->plane );
if (s == 1) {
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
else if (*(surf->data) == SF_FACE) {
// the face plane should go through the box
if (!vr_thirdPersonSpectator->integer)
s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane );
else
s = 0;
s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane );
if (s == 1 || s == 2) {
*surfViewCount = tr.viewCount;

View file

@ -80,11 +80,6 @@ static int R_CullModel( mdvModel_t *model, trRefEntity_t *ent ) {
mdvFrame_t *oldFrame, *newFrame;
int i;
if (vr_thirdPersonSpectator->integer)
{
return CULL_IN;
}
// compute frame pointers
newFrame = model->frames + ent->e.frame;
oldFrame = model->frames + ent->e.oldframe;
@ -329,17 +324,14 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
model = tr.currentModel->mdv[lod];
if (!vr_thirdPersonSpectator->integer)
//
// cull the entire model if merged bounding box of both frames
// is outside the view frustum.
//
cull = R_CullModel(model, ent);
if (cull == CULL_OUT)
{
//
// cull the entire model if merged bounding box of both frames
// is outside the view frustum.
//
cull = R_CullModel(model, ent);
if (cull == CULL_OUT)
{
return;
}
return;
}
//

View file

@ -1263,17 +1263,14 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
ent->e.oldframe = 0;
}
if (!vr_thirdPersonSpectator->integer)
//
// cull the entire model if merged bounding box of both frames
// is outside the view frustum.
//
cull = R_CullIQM(data, ent);
if (cull == CULL_OUT)
{
//
// cull the entire model if merged bounding box of both frames
// is outside the view frustum.
//
cull = R_CullIQM(data, ent);
if (cull == CULL_OUT)
{
return;
}
return;
}
//

View file

@ -32,7 +32,7 @@ added to the sorting list.
================
*/
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;
}
@ -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
// 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;
if ( planeBits & 1 ) {