diff --git a/engine/client/renderer.c b/engine/client/renderer.c index bc1bd5132..47b50a2a6 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -145,6 +145,7 @@ extern cvar_t gl_mindist; cvar_t gl_detail = SCVARF("gl_detail", "0", CVAR_ARCHIVE); cvar_t gl_detailscale = SCVAR("gl_detailscale", "5"); cvar_t gl_overbright = SCVARF("gl_overbright", "0", CVAR_ARCHIVE); +cvar_t gl_overbright_all = SCVARF("gl_overbright_all", "0", CVAR_ARCHIVE); cvar_t r_shadows = SCVARF("r_shadows", "0", CVAR_ARCHIVE|CVAR_RENDERERLATCH); cvar_t r_shadow_realtime_world = SCVARF("r_shadow_realtime_world", "0", CVAR_CHEAT|CVAR_ARCHIVE); cvar_t r_shadow_realtime_world_lightmaps = SCVARF("r_shadow_realtime_world_lightmaps", "0.8", CVAR_CHEAT); @@ -351,6 +352,7 @@ void GLRenderer_Init(void) Cvar_Register (&gl_detail, GRAPHICALNICETIES); Cvar_Register (&gl_detailscale, GRAPHICALNICETIES); Cvar_Register (&gl_overbright, GRAPHICALNICETIES); + Cvar_Register (&gl_overbright_all, GRAPHICALNICETIES); Cvar_Register (&gl_dither, GRAPHICALNICETIES); Cvar_Register (&r_fb_models, GRAPHICALNICETIES); Cvar_Register (&r_fb_bmodels, GRAPHICALNICETIES); diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 2614bb371..76d8a0b1c 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -5997,6 +5997,7 @@ int map_checksum; qboolean Mod_LoadQ2BrushModel (model_t *mod, void *buffer) { mod->fromgame = fg_quake2; + mod->engineflags |= MDLF_NEEDOVERBRIGHT; return CM_LoadMap(mod->name, buffer, true, &map_checksum) != NULL; } diff --git a/engine/gl/gl_alias.c b/engine/gl/gl_alias.c index e02d761b5..75c471ab8 100644 --- a/engine/gl/gl_alias.c +++ b/engine/gl/gl_alias.c @@ -3412,6 +3412,8 @@ qboolean GL_LoadQ1Model (model_t *mod, void *buffer) pq1inmodel = (dmdl_t *)buffer; + loadmodel->engineflags |= MDLF_NEEDOVERBRIGHT; + version = LittleLong(pq1inmodel->version); if (version == QTESTALIAS_VERSION) qtest = true; @@ -3701,6 +3703,8 @@ qboolean GL_LoadQ2Model (model_t *mod, void *buffer) loadmodel=mod; + loadmodel->engineflags |= MDLF_NEEDOVERBRIGHT; + Mod_DoCRC(mod, buffer, com_filesize); hunkstart = Hunk_LowMark (); diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 5bf074218..29f263864 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -2584,7 +2584,10 @@ qboolean GLMod_LoadBrushModel (model_t *mod, void *buffer) i = LittleLong (header->version); if (i == BSPVERSION || i == BSPVERSIONPREREL) + { loadmodel->fromgame = fg_quake; + loadmodel->engineflags |= MDLF_NEEDOVERBRIGHT; + } else if (i == BSPVERSIONHL) //halflife support loadmodel->fromgame = fg_halflife; else diff --git a/engine/gl/gl_model.h b/engine/gl/gl_model.h index 20e9d674c..398367e1b 100644 --- a/engine/gl/gl_model.h +++ b/engine/gl/gl_model.h @@ -810,6 +810,7 @@ typedef struct model_s #define MDLF_PLAYER 0x08 // players have specific lighting values #define MDLF_FLAME 0x10 // can be excluded with r_drawflame #define MDLF_DOCRC 0x20 // model needs CRC built +#define MDLF_NEEDOVERBRIGHT 0x40 // only overbright these models with gl_overbright_all set //============================================================================ /* diff --git a/engine/gl/gl_ppl.c b/engine/gl/gl_ppl.c index 0c53ad080..41ee5c92a 100644 --- a/engine/gl/gl_ppl.c +++ b/engine/gl/gl_ppl.c @@ -29,7 +29,7 @@ extern int lightmap_bytes; // 1, 2, or 4 extern cvar_t gl_detail; extern cvar_t gl_detailscale; -extern cvar_t gl_overbright; +extern cvar_t gl_overbright, gl_overbright_all; extern cvar_t r_fb_bmodels; extern cvar_t gl_part_flame; @@ -1651,12 +1651,14 @@ void PPL_BaseTextures(model_t *model) qglShadeModel(GL_FLAT); - if (gl_overbright.value>=2) - overbright = 4; - else if (gl_overbright.value) - overbright = 2; - else - overbright = 1; + overbright = 1; + if (gl_overbright_all.value || (model->engineflags & MDLF_NEEDOVERBRIGHT)) + { + if (gl_overbright.value>=2) + overbright = 4; + else if (gl_overbright.value) + overbright = 2; + } currentmodel = model;