new cvar r_alwaysmaxlod for PCVR build

This commit is contained in:
Simon 2023-08-06 17:37:42 +01:00
parent 9387dea98f
commit 8e7c1f69a4
7 changed files with 22 additions and 3 deletions

View file

@ -2185,7 +2185,8 @@ void G2API_AddSkinGore(CGhoul2Info_v &ghoul2,SSkinGoreData &gore)
int lod;
ResetGoreTag();
const int lodbias=Com_Clamp ( 0, 2,G2_DecideTraceLod(ghoul2[0],r_lodbias->integer));
const int lodbias= r_alwaysmaxlod->integer ? 0 :
Com_Clamp ( 0, 2,G2_DecideTraceLod(ghoul2[0],r_lodbias->integer));
const int maxLod =Com_Clamp (0,ghoul2[0].currentModel->numLods,3); //limit to the number of lods the main model has
for(lod=lodbias;lod<maxLod;lod++)
{

View file

@ -842,6 +842,11 @@ static int G2_ComputeLOD( trRefEntity_t *ent, const model_t *currentModel, int l
return(0);
}
if (r_alwaysmaxlod->integer)
{
return(0);
}
if (r_lodbias->integer > lodBias)
{
lodBias = r_lodbias->integer;

View file

@ -55,6 +55,7 @@ cvar_t *r_dynamiclight;
// rjr - removed for hacking cvar_t *r_dlightBacks;
cvar_t *r_lodbias;
cvar_t *r_alwaysmaxlod;
cvar_t *r_lodscale;
cvar_t *r_norefresh;
@ -1555,6 +1556,11 @@ void R_Register( void )
//
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE_ND );
r_lodbias = ri.Cvar_Get( "r_lodbias", "-2", CVAR_ARCHIVE_ND );
#ifdef _WIN32
r_alwaysmaxlod = ri.Cvar_Get( "r_alwaysmaxlod", "1", CVAR_ARCHIVE_ND );
#else
r_alwaysmaxlod = ri.Cvar_Get("r_alwaysmaxlod", "0", CVAR_ARCHIVE_ND);
#endif
r_flares = ri.Cvar_Get ("r_flares", "1", CVAR_ARCHIVE_ND );
r_lodscale = ri.Cvar_Get( "r_lodscale", "10", CVAR_ARCHIVE_ND );

View file

@ -1103,6 +1103,7 @@ extern cvar_t *r_texturebitslm; // number of desired lightmap texture bits
extern cvar_t *r_measureOverdraw; // enables stencil buffer overdraw measurement
extern cvar_t *r_lodbias; // push/pull LOD transitions
extern cvar_t * r_alwaysmaxlod; // force best LOD
extern cvar_t *r_lodscale;
extern cvar_t *r_primitives; // "0" = based on compiled vertex array existance

View file

@ -197,6 +197,11 @@ static int R_ComputeLOD( trRefEntity_t *ent ) {
return(0);
}
if (r_alwaysmaxlod->integer)
{
return(0);
}
// multiple LODs exist, so compute projected bounding sphere
// and use that as a criteria for selecting LOD
// if ( tr.currentModel->md3[0] )

View file

@ -722,7 +722,7 @@ Ghoul2 Insert End
// if we have a valid model and are biased
// so that we won't see any higher detail ones,
// stop loading them
if ( lod <= r_lodbias->integer ) {
if ( r_alwaysmaxlod->integer || lod <= r_lodbias->integer ) {
break;
}
}

View file

@ -1612,7 +1612,8 @@ static void RB_SurfaceLathe()
VectorSet2( l_oldpt, e->axis[0][0], e->axis[0][1] );
// do scalability stuff...r_lodbias 0-3
int lod = r_lodbias->integer + 1;
int lod = r_alwaysmaxlod->integer ? 1 :
r_lodbias->integer + 1;
if ( lod > 4 )
{
lod = 4;