From 0dbb8919be15624bf85f12ef1839beb430a4b94e Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 8 Jan 2022 09:59:54 +0000 Subject: [PATCH] Make the ent lighting distance match QS by default - increasing the distance from vanilla's 2048 to 8192. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6151 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_model.c | 2 ++ engine/gl/gl_rlight.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index befb302f9..6c8845994 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -40,6 +40,7 @@ cvar_t mod_litsprites_force = CVARD("mod_litsprites_force", "0", "If set to cvar_t mod_loadmappackages = CVARD ("mod_loadmappackages", "1", "Load additional content embedded within bsp files."); cvar_t mod_lightscale_broken = CVARFD("mod_lightscale_broken", "0", CVAR_RENDERERLATCH, "When active, replicates a bug from vanilla - the radius of r_dynamic lights is scaled by per-surface texture scale rather than using actual distance."); cvar_t temp_lit2support = CVARD("temp_mod_lit2support", "0", "Set to 1 to enable lit2 support. This cvar will be removed once the format is finalised."); +cvar_t mod_lightpoint_distance = CVARD("mod_lightpoint_distance", "8192", "This is the maximum distance to trace when searching for a ground surface for lighting info on map formats without light more fancy lighting info. Use 2048 for full compat with Quake."); #ifdef SPRMODELS cvar_t r_sprite_backfacing = CVARD ("r_sprite_backfacing", "0", "Make oriented sprites face backwards relative to their orientation, for compat with q1."); #endif @@ -661,6 +662,7 @@ void Mod_Init (qboolean initial) Cvar_Register(&mod_loadentfiles_dir, NULL); Cvar_Register(&mod_loadmappackages, NULL); Cvar_Register(&mod_lightscale_broken, NULL); + Cvar_Register(&mod_lightpoint_distance, NULL); Cvar_Register(&temp_lit2support, NULL); Cvar_Register (&r_meshpitch, "Gamecode"); Cvar_Register (&r_meshroll, "Gamecode"); diff --git a/engine/gl/gl_rlight.c b/engine/gl/gl_rlight.c index caa51a217..0a236e57e 100644 --- a/engine/gl/gl_rlight.c +++ b/engine/gl/gl_rlight.c @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern cvar_t r_shadow_realtime_world, r_shadow_realtime_world_lightmaps; extern cvar_t r_hdr_irisadaptation, r_hdr_irisadaptation_multiplier, r_hdr_irisadaptation_minvalue, r_hdr_irisadaptation_maxvalue, r_hdr_irisadaptation_fade_down, r_hdr_irisadaptation_fade_up; +extern cvar_t mod_lightpoint_distance; int r_dlightframecount; int d_lightstylevalue[MAX_NET_LIGHTSTYLES]; // 8.8 fraction of base light value @@ -2671,7 +2672,7 @@ int R_LightPoint (vec3_t p) end[0] = p[0]; end[1] = p[1]; - end[2] = p[2] - 2048; + end[2] = p[2] - mod_lightpoint_distance.value; r = GLRecursiveLightPoint (cl.worldmodel->rootnode, p, end); @@ -2942,7 +2943,7 @@ void GLQ1BSP_LightPointValues(model_t *model, const vec3_t point, vec3_t res_dif end[0] = point[0]; end[1] = point[1]; - end[2] = point[2] - 2048; + end[2] = point[2] - mod_lightpoint_distance.value; r = GLRecursiveLightPoint3C(model, model->rootnode, point, end); if (r == NULL)