diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0c3c86e74b..1018c1a9a0 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1097,7 +1097,11 @@ LLRender::LLRender() mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0), mMaxAnisotropy(0.f), - mLineWidth(1.f) // Line width OGL core profile fix by Rye Mutt + mLineWidth(1.f), // Line width OGL core profile fix by Rye Mutt + // Don't ignore OpenGL max line width + mMaxLineWidthSmooth(1.f), + mMaxLineWidthAliased(1.f) + // { mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS); for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++) @@ -1163,6 +1167,15 @@ void LLRender::init() initVB(); // stop_glerror(); + + // Don't ignore OpenGL max line width + GLint range[2]; + glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, range); + mMaxLineWidthAliased = F32(range[1]); + glGetIntegerv(GL_SMOOTH_LINE_WIDTH_RANGE, range); + mMaxLineWidthSmooth = F32(range[1]); + stop_glerror(); + // } void LLRender::shutdown() @@ -1896,6 +1909,10 @@ void LLRender::setLineWidth(F32 line_width) { line_width = 1.f; } + else if (line_width > 1.f) + { + line_width = llmin(line_width, glIsEnabled(GL_LINE_SMOOTH) ? mMaxLineWidthSmooth : mMaxLineWidthAliased); + } if (mLineWidth != line_width || mDirty) { if (mMode == LLRender::LINES || mMode == LLRender::LINE_STRIP) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index c2b180459b..8499563838 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -502,6 +502,10 @@ private: eCompareFunc mCurrAlphaFunc; F32 mCurrAlphaFuncVal; F32 mLineWidth; // Line width OGL core profile fix by Rye Mutt + // Don't ignore OpenGL max line width + F32 mMaxLineWidthSmooth; + F32 mMaxLineWidthAliased; + // LLPointer mBuffer; LLStrider mVerticesp;