]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
tighten the tolerances on water plane merging
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Sep 2011 11:16:59 +0000 (11:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Sep 2011 11:16:59 +0000 (11:16 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11359 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 9feccb85088a84cb0c4d2c5c8fada5cf5f843fdc..8bd4e908717fc52e29949f3f1c09e14a9f021ef3 100644 (file)
@@ -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;