Merge pull request #35 from lvonasek/feature_opengl_tweaks

Geometry detail improved
This commit is contained in:
Simon 2022-03-29 22:42:50 +01:00 committed by GitHub
commit 7b4ac44cdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View file

@ -741,8 +741,8 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
} }
else else
{ {
trap_Cvar_SetValue( "r_lodBias", 1 ); trap_Cvar_SetValue( "r_lodBias", 2 );
trap_Cvar_SetValue( "r_subdivisions", 20 ); trap_Cvar_SetValue( "r_subdivisions", 80 );
} }
if ( s_graphicsoptions.filter.curvalue ) if ( s_graphicsoptions.filter.curvalue )

View file

@ -164,6 +164,19 @@ R_ComputeLOD
================= =================
*/ */
int R_ComputeLOD( trRefEntity_t *ent ) { int R_ComputeLOD( trRefEntity_t *ent ) {
//HACK: force specific LOD (for VR it fits better)
if (1)
{
//high -> 0, medium -> 2, low -> 4
int lod = r_lodbias->integer + r_lodbias->integer;
if (lod >= tr.currentModel->numLods)
lod = tr.currentModel->numLods - 1;
if (lod < 0)
lod = 0;
return lod;
}
float radius; float radius;
float flod, lodscale; float flod, lodscale;
float projectedRadius; float projectedRadius;

View file

@ -1105,10 +1105,10 @@ Responsible for doing a swapbuffers
*/ */
void GLimp_EndFrame( void ) void GLimp_EndFrame( void )
{ {
// don't flip if drawing to front buffer //swap window is implemented in VR API, no need to do it here
if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
{ {
SDL_GL_SwapWindow( SDL_window ); //SDL_GL_SwapWindow( SDL_window );
} }
if( r_fullscreen->modified ) if( r_fullscreen->modified )