From 9ede88f8be888f0441f9a8cb4821af088fa3b42a Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 14 Nov 2021 03:15:17 +0000 Subject: [PATCH] Tweak scenecache some more for more smoothness. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6128 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/r_surf.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index 21a90a18a..9d3134ce2 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -3419,17 +3419,13 @@ void Surf_DrawWorld (void) //if they teleported, don't show something ugly - like obvious wallhacks. if (webogenerating && !r_novis.ival && cl.splitclients<=1 && webostate && (webostate->cluster[0] != r_viewcluster || webostate->cluster[1] != r_viewcluster2)) { - if (bestdist > 32 && memcmp(webostate->pvs.buffer, webogenerating->wmodel->funcs.ClusterPVS(webogenerating->wmodel, webogenerating->cluster[0], NULL, PVM_FAST), webostate->pvs.buffersize)) + vec3_t m; + float d; + VectorSubtract(webostate->lastpos, r_refdef.vieworg, m); + d = sqrt(DotProduct(m,m)); + if (d > 40 && memcmp(webostate->pvs.buffer, webogenerating->wmodel->funcs.ClusterPVS(webogenerating->wmodel, webogenerating->cluster[0], NULL, PVM_FAST), webostate->pvs.buffersize)) { - /*if (es->cluster[1] != -1 && es->cluster[0] != es->cluster[1]) - { //view is near to a water boundary. this implies the water crosses the near clip plane. we need both leafs. - pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[0], &es->pvs, PVM_REPLACE); - pvs = es->wmodel->funcs.ClusterPVS(es->wmodel, es->cluster[1], &es->pvs, PVM_MERGE); - } - else*/ -// pvs = webogenerating->wmodel->funcs.ClusterPVS(webogenerating->wmodel, webogenerating->cluster[0], NULL, PVM_FAST); - - Con_DLPrintf(2, "Blocking for scenecache generation (distance = %g)\n", bestdist); + Con_DLPrintf(2, "Blocking for scenecache generation (distance = %g)\n", d); webostate = webogenerating; COM_WorkerPartialSync(webogenerating, &webogeneratingstate, true); }