diff --git a/engine/client/render.h b/engine/client/render.h index e330de547..ac641d4eb 100644 --- a/engine/client/render.h +++ b/engine/client/render.h @@ -611,6 +611,7 @@ extern cvar_t r_waterwarp; extern cvar_t r_fullbright; extern cvar_t r_lightmap; extern cvar_t r_glsl_offsetmapping; +extern cvar_t r_skyfog; //additional fog alpha on sky extern cvar_t r_shadow_playershadows; extern cvar_t r_shadow_realtime_dlight, r_shadow_realtime_dlight_shadows; extern cvar_t r_shadow_realtime_dlight_ambient; diff --git a/engine/client/renderer.c b/engine/client/renderer.c index b7d3f4a0c..1bf1e6852 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -203,6 +203,7 @@ cvar_t r_wallcolour = CVARAF ("r_wallcolour", "128 128 128", "r_wallcolor", CVAR_RENDERERCALLBACK|CVAR_SHADERSYSTEM);//FIXME: broken //cvar_t r_walltexture = CVARF ("r_walltexture", "", // CVAR_RENDERERCALLBACK|CVAR_SHADERSYSTEM); //FIXME: broken +cvar_t r_skyfog = CVARD ("r_skyfog", "0.5", "This controls an alpha-blend value for fog on skyboxes, cumulative with regular fog alpha."); cvar_t r_wateralpha = CVARF ("r_wateralpha", "1", CVAR_ARCHIVE | CVAR_SHADERSYSTEM); cvar_t r_lavaalpha = CVARF ("r_lavaalpha", "", @@ -842,6 +843,7 @@ void Renderer_Init(void) Cvar_Register (&r_mirroralpha, GLRENDEREROPTIONS); Cvar_Register (&r_softwarebanding_cvar, GRAPHICALNICETIES); + Cvar_Register (&r_skyfog, GRAPHICALNICETIES); Cvar_Register (&r_skyboxname, GRAPHICALNICETIES); Cmd_AddCommand("sky", R_ForceSky_f); //QS compat Cmd_AddCommand("loadsky", R_ForceSky_f);//DP compat diff --git a/engine/client/wad.c b/engine/client/wad.c index d9d695ee4..16eb60c7a 100644 --- a/engine/client/wad.c +++ b/engine/client/wad.c @@ -838,6 +838,8 @@ void Mod_ParseInfoFromEntityLump(model_t *wmodel) //actually, this should be in Q_strncatz(wads, token, sizeof(wads)); //cache it for later (so that we don't play with any temp memory yet) #endif } + else if (!strcmp("skyfog", key)) //override cvars so mappers don't end up hacking cvars and fucking over configs (at least in other engines). + Cvar_LockFromServer(&r_skyfog, token); else if (!strcmp("fog", key) || !strcmp("airfog", key)) //q1 extension. FIXME: should be made temporary. { key[0] = 'f';