From 0867431f269c5be624ee9db6828ef82380540c82 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 3 Mar 2012 12:53:23 +0100 Subject: [PATCH] do the same improvement for model LOD code too --- defaultXonotic.cfg | 7 ++++--- qcsrc/client/autocvars.qh | 6 +++--- qcsrc/client/wall.qc | 25 +++++++++++++------------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index d0f67edf4..087223aff 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1569,9 +1569,10 @@ set menu_updatecheck 1 set bot_navigation_ignoreplayers 0 // FIXME remove this once the issue is solved set bot_sound_monopoly 0 "when enabled, only bots can make any noise" -set sv_loddistance1 1024 -set sv_loddistance2 4096 -seta cl_playerdetailreduction 0 "the higher, the less detailed player models are displayed (LOD)" +set cl_loddistance1 768 +set cl_loddistance2 2048 +seta cl_playerdetailreduction 1 "the higher, the less detailed player models are displayed (LOD)" +seta cl_modeldetailreduction 1 "the higher, the less detailed certain map models are displayed (LOD)" set g_mapinfo_settemp_acl "+*" "ACL for mapinfo setting cvars" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 76edca95a..43dd0dd18 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -339,7 +339,6 @@ float autocvar_hud_shownames_antioverlap; float autocvar_hud_shownames_antioverlap_distance; float autocvar_hud_shownames_offset; string autocvar_hud_skin; -float autocvar_loddebug; float autocvar_menu_mouse_speed; string autocvar_menu_skin; float autocvar_r_fakelight; @@ -387,8 +386,9 @@ float autocvar_cl_damageeffect_lifetime; float autocvar_cl_damageeffect_lifetime_min; float autocvar_cl_damageeffect_lifetime_max; float autocvar_cl_playerdetailreduction; -float autocvar_cl_loddistance1 = 1024; -float autocvar_cl_loddistance2 = 4096; +float autocvar_cl_modeldetailreduction; +float autocvar_cl_loddistance1 = 768; +float autocvar_cl_loddistance2 = 2048; float autocvar_cl_forceplayermodels; float autocvar_cl_forceplayercolors; string autocvar_cl_forcemyplayermodel; diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index 0a0bfa9ec..64f5830f4 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -17,25 +17,26 @@ void Ent_Wall_Draw() if(self.lodmodelindex1) { - d = autocvar_loddebug; - if(d > 0) + if(autocvar_cl_modeldetailreduction <= 0) { - if(d == 1) - self.modelindex = self.lodmodelindex0; - else if(d == 2 || !self.lodmodelindex2) - self.modelindex = self.lodmodelindex1; - else // if(d == 3) + if(self.lodmodelindex2 && autocvar_cl_modeldetailreduction <= -2) self.modelindex = self.lodmodelindex2; + else if(autocvar_cl_modeldetailreduction <= -1) + self.modelindex = self.lodmodelindex1; + else + self.modelindex = self.lodmodelindex0; } else { - d = vlen(NearestPointOnBox(self, view_origin) - view_origin); - if(d < self.loddistance1) - self.modelindex = self.lodmodelindex0; - else if(!self.lodmodelindex2 || d < self.loddistance2) + float distance = vlen(NearestPointOnBox(self, view_origin) - view_origin); + float f = (distance * current_viewzoom + 100.0) * autocvar_cl_modeldetailreduction; + f *= 1.0 / bound(0.01, view_quality, 1); + if(self.lodmodelindex2 && f > self.loddistance2) + self.modelindex = self.lodmodelindex2; + else if(f > self.loddistance1) self.modelindex = self.lodmodelindex1; else - self.modelindex = self.lodmodelindex2; + self.modelindex = self.lodmodelindex0; } } -- 2.39.2