From 0c1fc78bd94014ee19da690f16cef64c13e50771 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 Jan 2012 12:40:11 -0600 Subject: SH-2794 Map buffer now performs as well as buffersubdata --- indra/newview/llvowater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvowater.cpp') diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 7df50ec815..315616e8a5 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -167,7 +167,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) indices_per_quad * num_quads); LLVertexBuffer* buff = face->getVertexBuffer(); - if (!buff) + if (!buff || !buff->isWriteable()) { buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB); buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE); -- cgit v1.2.3 From 95be0571537805c238e37e747c4c3bb298be98d8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 7 Feb 2012 17:25:12 -0600 Subject: SH-2719 Fix for lines in off-sim water --- indra/newview/llvowater.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvowater.cpp') 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; -- cgit v1.2.3