Skip to content

Commit

Permalink
ref: gl: add cvar r_large_lightmaps to enable larger lightmap sizes, …
Browse files Browse the repository at this point in the history
…opt-in, yields better performance with VBO renderer
  • Loading branch information
a1batross committed Feb 5, 2025
1 parent 23940f8 commit 3ebcb08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ref/gl/gl_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ extern convar_t r_shadows;
extern convar_t r_ripple;
extern convar_t r_ripple_updatetime;
extern convar_t r_ripple_spawntime;
extern convar_t r_large_lightmaps;

//
// engine shared convars
Expand Down
2 changes: 2 additions & 0 deletions ref/gl/gl_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ CVAR_DEFINE( r_vbo_overbrightmode, "gl_vbo_overbrightmode", "0", FCVAR_GLCONFIG,
CVAR_DEFINE_AUTO( r_ripple, "0", FCVAR_GLCONFIG, "enable software-like water texture ripple simulation" );
CVAR_DEFINE_AUTO( r_ripple_updatetime, "0.05", FCVAR_GLCONFIG, "how fast ripple simulation is" );
CVAR_DEFINE_AUTO( r_ripple_spawntime, "0.1", FCVAR_GLCONFIG, "how fast new ripples spawn" );
CVAR_DEFINE_AUTO( r_large_lightmaps, "0", FCVAR_GLCONFIG|FCVAR_LATCH, "enable larger lightmap atlas textures (might break custom renderer mods)" );

DEFINE_ENGINE_SHARED_CVAR_LIST()

Expand Down Expand Up @@ -1147,6 +1148,7 @@ static void GL_InitCommands( void )
gEngfuncs.Cvar_RegisterVariable( &r_vbo_dlightmode );
gEngfuncs.Cvar_RegisterVariable( &r_vbo_overbrightmode );
gEngfuncs.Cvar_RegisterVariable( &r_vbo_detail );
gEngfuncs.Cvar_RegisterVariable( &r_large_lightmaps );

gEngfuncs.Cvar_RegisterVariable( &gl_extensions );
gEngfuncs.Cvar_RegisterVariable( &gl_texture_nearest );
Expand Down
2 changes: 1 addition & 1 deletion ref/gl/gl_rsurf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3858,7 +3858,7 @@ void GL_BuildLightmaps( void )
memset( &RI, 0, sizeof( RI ));

// update the lightmap blocksize
if( FBitSet( gp_host->features, ENGINE_LARGE_LIGHTMAPS ) || tr.world->version == QBSP2_VERSION )
if( FBitSet( gp_host->features, ENGINE_LARGE_LIGHTMAPS ) || tr.world->version == QBSP2_VERSION || r_large_lightmaps.value )
tr.block_size = BLOCK_SIZE_MAX;
else tr.block_size = BLOCK_SIZE_DEFAULT;

Expand Down

0 comments on commit 3ebcb08

Please sign in to comment.