diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-04-20 03:36:21 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-04-20 03:36:21 -0700 |
commit | b2344cfd13bc0dc7175cf3895b7111186dc573c9 (patch) | |
tree | 2350c8294e38b253aedf30c39c064a0030ec2ff9 /indra | |
parent | abb72591d4f480e90ee66951b49d34f90dd7c96c (diff) |
Fix rendering artifacts on Mac Mobile GeForce cards
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 1 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 7 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 191c9862f0..594edd43d5 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -280,6 +280,7 @@ void LLGLSLShader::unload() mTexture.clear(); mUniform.clear(); mShaderFiles.clear(); + mDefines.clear(); if (mProgramObject) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 7752189e1d..09a2d4467a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -622,6 +622,13 @@ void main() #else frag_data[0] = final_color; + +#ifdef UGLY_MAC_HACK + // magic spec exp clamp fixes rendering artifacts on older mac GF drivers + // + final_specular = min(final_specular, vec4(1.0f, 1.0f, 1.0f, 0.125f)); +#endif + frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 218bbbe6dc..3afbc6adca 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1210,8 +1210,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredSkinnedAlphaProgram.mShaderFiles.clear(); - gDeferredSkinnedAlphaProgram.mDefines.clear(); - gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; @@ -1262,6 +1260,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[i].addPermutation("HAS_SUN_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); + + #if LL_DARWIN + // include spec exp clamp to fix older mac rendering artifacts + // + if (gGLManager.mIsMobileGF) + { + gDeferredMaterialProgram[i].addPermutation("UGLY_MAC_HACK","1"); + } + #endif + if (has_skin) { gDeferredMaterialProgram[i].mFeatures.hasObjectSkinning = true; @@ -1409,8 +1417,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } gDeferredAlphaProgram.mShaderFiles.clear(); - gDeferredAlphaProgram.mDefines.clear(); - gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); |