summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-02-07 17:25:12 -0600
committerDave Parks <davep@lindenlab.com>2012-02-07 17:25:12 -0600
commit95be0571537805c238e37e747c4c3bb298be98d8 (patch)
treeb6962aa3401023d8967939aa8b0df33f2f572065
parent8c15a7e17fceeba9e55e254d7654c1a4f8c3b871 (diff)
SH-2719 Fix for lines in off-sim water
-rw-r--r--indra/newview/llvowater.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 315616e8a5..cd78157944 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -160,7 +160,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
static const unsigned int vertices_per_quad = 4;
static const unsigned int indices_per_quad = 6;
- const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction ? 16 : 1;
+ const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && LLGLSLShader::sNoFixedFunction ? 16 : 1;
const S32 num_quads = size * size;
face->setSize(vertices_per_quad * num_quads,
@@ -197,6 +197,13 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
F32 size_inv = 1.f / size;
+ F32 z_fudge = 0.f;
+
+ if (getIsEdgePatch())
+ { //bump edge patches down 10 cm to prevent aliasing along edges
+ z_fudge = -0.1f;
+ }
+
for (y = 0; y < size; y++)
{
for (x = 0; x < size; x++)
@@ -205,6 +212,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
position_agent = getPositionAgent() - getScale() * 0.5f;
position_agent.mV[VX] += (x + 0.5f) * step_x;
position_agent.mV[VY] += (y + 0.5f) * step_y;
+ position_agent.mV[VZ] += z_fudge;
*verticesp++ = position_agent - right + up;
*verticesp++ = position_agent - right - up;