]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
do the same improvement for model LOD code too
authorRudolf Polzer <divverent@alientrap.org>
Sat, 3 Mar 2012 11:53:23 +0000 (12:53 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 3 Mar 2012 11:53:23 +0000 (12:53 +0100)
defaultXonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/wall.qc

index d0f67edf4291464f647b2c3e5687bbd60239123d..087223aff9725b3caf2d3e642c44d21df41cb7de 100644 (file)
@@ -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"
 
index 76edca95a59195f34ffd8dd30c78b0e21515a269..43dd0dd1834bd76fea1b760fefca9489d4c75f8a 100644 (file)
@@ -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;
index 0a0bfa9ec143208ed3f2f286f6cf776f181fbb12..64f5830f4c57322c8bc89bd796afa50d9f9883d0 100644 (file)
@@ -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;
                }
        }