diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 12 | ||||
-rwxr-xr-x | indra/newview/llface.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 21 |
3 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 344079b640..ebb01fb330 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8592,6 +8592,18 @@ </array> </map> + <key>RenderSpecularPrecision</key> + <map> + <key>Comment</key> + <string>Force 32-bit floating point LUT</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderSpecularResX</key> <map> <key>Comment</key> diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f021f4ed0f..700b31f8d3 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -817,12 +817,6 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, size.mul(scale); } - // Catch potential badness from normalization before it happens - // - llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); - mat_normal.mMatrix[0].normalize3fast(); mat_normal.mMatrix[1].normalize3fast(); mat_normal.mMatrix[2].normalize3fast(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d37b086ae3..442b0b6d2d 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1201,7 +1201,15 @@ void LLPipeline::releaseLUTBuffers() { if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 0, 1, &mLightFunc); + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + pix_format = GL_R32F; +#endif + + LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, pix_format, 0, 1, &mLightFunc); mLightFunc = 0; } } @@ -1400,13 +1408,18 @@ void LLPipeline::createLUTBuffers() ls[y*lightResX+x] = k;*/ } } - - U32 pix_format = GL_R16F; -#if LL_DARWIN // Need to work around limited precision with 10.6.8 and older drivers // + U32 use_high_precision = gSavedSettings.getU32("RenderSpecularPrecision"); + + U32 pix_format = use_high_precision ? GL_R32F : GL_R16F; + +#if LL_DARWIN + // Forced to work around 10.6.8. driver bugs on most every GPU + // pix_format = GL_R32F; #endif + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); |