mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Deleted gl1_biglightmaps
glTexSubImage2D() calls are very slow, and are even slower when the texture is big. Dynamic lighting changes are small compared to the huge 512x512 size of the lightmap this option provided, so it was detrimental to performance. Original logic remains underneath if there's a need of a comeback.
This commit is contained in:
parent
24b546ba54
commit
15a1ebdd74
3 changed files with 8 additions and 33 deletions
|
@ -471,10 +471,6 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
|
|||
|
||||
## Graphics (OpenGL 1.4 only)
|
||||
|
||||
* **gl1_biglightmaps**: Enables lightmaps and scrap to use a bigger
|
||||
texture size, which means fewer texture switches, improving
|
||||
performance. Default is `1` (enabled). Requires a `vid_restart`.
|
||||
|
||||
* **gl1_intensity**: Sets the color intensity. Must be a floating point
|
||||
value, at least `1.0` - default is `2.0`. Applied when textures are
|
||||
loaded, so it needs a `vid_restart`.
|
||||
|
|
|
@ -91,7 +91,6 @@ cvar_t *gl1_particle_square;
|
|||
cvar_t *gl1_palettedtexture;
|
||||
cvar_t *gl1_pointparameters;
|
||||
cvar_t *gl1_multitexture;
|
||||
cvar_t *gl1_biglightmaps;
|
||||
|
||||
cvar_t *gl_drawbuffer;
|
||||
cvar_t *gl_lightmap;
|
||||
|
@ -1221,7 +1220,6 @@ R_Register(void)
|
|||
gl1_palettedtexture = ri.Cvar_Get("r_palettedtextures", "0", CVAR_ARCHIVE);
|
||||
gl1_pointparameters = ri.Cvar_Get("gl1_pointparameters", "1", CVAR_ARCHIVE);
|
||||
gl1_multitexture = ri.Cvar_Get("gl1_multitexture", "1", CVAR_ARCHIVE);
|
||||
gl1_biglightmaps = ri.Cvar_Get("gl1_biglightmaps", "1", CVAR_ARCHIVE);
|
||||
|
||||
gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0);
|
||||
r_vsync = ri.Cvar_Get("r_vsync", "1", CVAR_ARCHIVE);
|
||||
|
@ -1402,7 +1400,7 @@ R_SetMode(void)
|
|||
qboolean
|
||||
RI_Init(void)
|
||||
{
|
||||
int j, max_tex_size;
|
||||
int j;
|
||||
byte *colormap;
|
||||
extern float r_turbsin[256];
|
||||
|
||||
|
@ -1621,35 +1619,17 @@ RI_Init(void)
|
|||
|
||||
// ----
|
||||
|
||||
/* Big lightmaps */
|
||||
R_Printf(PRINT_ALL, " - Big lightmaps: ");
|
||||
/* Big lightmaps: this used to be fast, but after the implementation of the "GL Buffer", it
|
||||
* became too evident that the bigger the texture, the slower the call to glTexSubImage2D() is.
|
||||
* Original logic remains, but it's preferable not to make it visible to the user.
|
||||
* Let's see if something changes in the future.
|
||||
*/
|
||||
|
||||
gl_state.block_width = BLOCK_WIDTH;
|
||||
gl_state.block_height = BLOCK_HEIGHT;
|
||||
gl_state.max_lightmaps = MAX_LIGHTMAPS;
|
||||
gl_state.scrap_width = BLOCK_WIDTH;
|
||||
gl_state.scrap_height = BLOCK_HEIGHT;
|
||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_tex_size);
|
||||
if (max_tex_size > BLOCK_WIDTH)
|
||||
{
|
||||
if (gl1_biglightmaps->value)
|
||||
{
|
||||
gl_state.block_width = gl_state.block_height = Q_min(max_tex_size, 512);
|
||||
gl_state.max_lightmaps = (BLOCK_WIDTH * BLOCK_HEIGHT * MAX_LIGHTMAPS)
|
||||
/ (gl_state.block_width * gl_state.block_height);
|
||||
gl_state.scrap_width = gl_state.scrap_height =
|
||||
(gl_config.npottextures)? Q_min(max_tex_size, 384) : Q_min(max_tex_size, 256);
|
||||
R_Printf(PRINT_ALL, "Okay\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Disabled\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Failed, detected texture size = %d\n", max_tex_size);
|
||||
}
|
||||
gl_state.scrap_width = BLOCK_WIDTH * 2;
|
||||
gl_state.scrap_height = BLOCK_HEIGHT * 2;
|
||||
|
||||
// ----
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ extern cvar_t *gl1_overbrightbits;
|
|||
extern cvar_t *gl1_palettedtexture;
|
||||
extern cvar_t *gl1_pointparameters;
|
||||
extern cvar_t *gl1_multitexture;
|
||||
extern cvar_t *gl1_biglightmaps;
|
||||
|
||||
extern cvar_t *gl1_particle_min_size;
|
||||
extern cvar_t *gl1_particle_max_size;
|
||||
|
|
Loading…
Reference in a new issue