From 312e474b1be3555df31be8f8cdcdc1c6ce55a33c Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 16 Sep 2011 11:16:59 +0000 Subject: [PATCH] tighten the tolerances on water plane merging git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11359 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 9feccb85..8bd4e908 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -5675,7 +5675,7 @@ void R_Water_AddWaterPlane(msurface_t *surface, int entno) { if(p->camera_entity == t->camera_entity) { - planescore = 100.0f - 100.0f * DotProduct(plane.normal, p->plane.normal) + fabs(plane.dist - p->plane.dist) * 25.0f; + planescore = 1.0f - DotProduct(plane.normal, p->plane.normal) + fabs(plane.dist - p->plane.dist) * 0.001f; if (bestplaneindex < 0 || bestplanescore > planescore) { bestplaneindex = planeindex; @@ -5687,7 +5687,7 @@ void R_Water_AddWaterPlane(msurface_t *surface, int entno) p = r_waterstate.waterplanes + planeindex; // if this surface does not fit any known plane rendered this frame, add one - if ((planeindex < 0 || bestplanescore > 100.0f) && r_waterstate.numwaterplanes < r_waterstate.maxwaterplanes) + if ((planeindex < 0 || bestplanescore > 0.001f) && r_waterstate.numwaterplanes < r_waterstate.maxwaterplanes) { // store the new plane planeindex = r_waterstate.numwaterplanes; -- 2.39.2