From f3130b85e6ddbff7b0ce700c52d3eb54d9c98b71 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 28 Jul 2011 17:51:00 -0600 Subject: fix for SH-2023: Brightness Bump maps don't load when shadows are enabled --- indra/newview/lldrawpoolbump.cpp | 4 ++-- indra/newview/llvovolume.cpp | 19 +++++++++++-------- indra/newview/llvovolume.h | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index d801f6df18..6f71c54f79 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1073,8 +1073,8 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText if (!src_image->hasCallbacks()) { //if image has no callbacks but resolutions don't match, trigger raw image loaded callback again if (src_image->getWidth() != bump->getWidth() || - src_image->getHeight() != bump->getHeight() || - (LLPipeline::sRenderDeferred && bump->getComponents() != 4)) + src_image->getHeight() != bump->getHeight())// || + //(LLPipeline::sRenderDeferred && bump->getComponents() != 4)) { src_image->setBoostLevel(LLViewerTexture::BOOST_BUMP) ; src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()), NULL ); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4c137d3394..d8b02fab27 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -704,19 +704,22 @@ BOOL LLVOVolume::isVisible() const return FALSE ; } -void LLVOVolume::updateTextureVirtualSize() +void LLVOVolume::updateTextureVirtualSize(bool forced) { LLFastTimer ftm(FTM_VOLUME_TEXTURES); // Update the pixel area of all faces - if(!isVisible()) + if(!forced) { - return ; - } + if(!isVisible()) + { + return ; + } - if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE)) - { - return; + if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SIMPLE)) + { + return; + } } static LLCachedControl dont_load_textures(gSavedSettings,"TextureDisable"); @@ -3995,7 +3998,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } llassert_always(vobj); - vobj->updateTextureVirtualSize(); + vobj->updateTextureVirtualSize(true); vobj->preRebuild(); drawablep->clearState(LLDrawable::HAS_ALPHA); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index fc00f0c0d0..13565cb27c 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -206,7 +206,7 @@ public: /*virtual*/ BOOL updateLOD(); void updateRadius(); /*virtual*/ void updateTextures(); - void updateTextureVirtualSize(); + void updateTextureVirtualSize(bool forced = false); void updateFaceFlags(); void regenFaces(); -- cgit v1.2.3 From 8ec39da3468f53af85d0cd4d4d9c54a72d6b8152 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 29 Jul 2011 17:46:16 -0500 Subject: SH-2181 Fix for alpha flickering when basic shaders enabled (don't use glAlphaFunc when shaders are available). Reviewed by Leslie --- indra/llrender/llgl.cpp | 11 ++ indra/llrender/llglslshader.cpp | 13 +- indra/llrender/llglslshader.h | 5 + indra/llrender/llrender.cpp | 29 ++++ indra/llrender/llshadermgr.cpp | 106 ++++++++++-- .../shaders/class1/deferred/diffuseAlphaMaskF.glsl | 30 ++++ .../class1/deferred/diffuseAlphaMaskIndexedF.glsl | 26 +++ .../shaders/class1/deferred/shadowAlphaMaskF.glsl | 27 ++++ .../shaders/class1/deferred/shadowAlphaMaskV.glsl | 23 +++ .../shaders/class1/deferred/shadowF.glsl | 4 +- .../shaders/class1/deferred/shadowV.glsl | 3 - .../shaders/class2/lighting/lightAlphaMaskF.glsl | 30 ++++ .../class2/lighting/lightAlphaMaskNonIndexedF.glsl | 33 ++++ .../class2/lighting/lightFullbrightAlphaMaskF.glsl | 29 ++++ .../lightFullbrightNonIndexedAlphaMaskF.glsl | 31 ++++ .../lighting/lightFullbrightWaterAlphaMaskF.glsl | 29 ++++ .../lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 29 ++++ .../class2/lighting/lightWaterAlphaMaskF.glsl | 27 ++++ .../lighting/lightWaterAlphaMaskNonIndexedF.glsl | 31 ++++ indra/newview/lldrawpoolalpha.cpp | 69 +++++--- indra/newview/lldrawpoolavatar.cpp | 17 +- indra/newview/lldrawpoolsimple.cpp | 27 ++-- indra/newview/lldrawpooltree.cpp | 36 +++-- indra/newview/lldrawpoolwlsky.cpp | 3 +- indra/newview/llselectmgr.cpp | 2 - indra/newview/llviewerprecompiledheaders.h | 4 +- indra/newview/llviewershadermgr.cpp | 177 +++++++++++++++++++++ indra/newview/llviewershadermgr.h | 9 ++ indra/newview/llvoavatar.cpp | 14 +- indra/newview/pipeline.cpp | 13 +- 30 files changed, 787 insertions(+), 100 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8937726209..2f6ef2b663 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -48,6 +48,7 @@ #include "llstacktrace.h" #include "llglheaders.h" +#include "llglslshader.h" #ifdef _DEBUG //#define GL_STATE_VERIFY @@ -1781,6 +1782,16 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE) { + if (LLGLSLShader::sNoFixedFunction) + { //always disable state that's deprecated post GL 3.0 + switch (state) + { + case GL_ALPHA_TEST: + enabled = 0; + break; + } + } + stop_glerror(); if (state) { diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 80c93bb0d2..f51d83abe4 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -49,6 +49,7 @@ using std::make_pair; using std::string; GLhandleARB LLGLSLShader::sCurBoundShader = 0; +LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL; bool LLGLSLShader::sNoFixedFunction = false; //UI shader -- declared here so llui_libtest will link properly @@ -63,7 +64,8 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) LLShaderFeatures::LLShaderFeatures() : calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false), hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false), -hasGamma(false), hasLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false) +hasGamma(false), hasLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false), +hasAlphaMask(false) { } @@ -386,6 +388,7 @@ void LLGLSLShader::bind() { glUseProgramObjectARB(mProgramObject); sCurBoundShader = mProgramObject; + sCurBoundShaderPtr = this; if (mUniformsDirty) { LLShaderMgr::instance()->updateShaderUniforms(this); @@ -410,6 +413,7 @@ void LLGLSLShader::unbind() } glUseProgramObjectARB(0); sCurBoundShader = 0; + sCurBoundShaderPtr = NULL; stop_glerror(); } } @@ -418,6 +422,7 @@ void LLGLSLShader::bindNoShader(void) { glUseProgramObjectARB(0); sCurBoundShader = 0; + sCurBoundShaderPtr = NULL; } S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode) @@ -979,3 +984,9 @@ void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v) glVertexAttrib4fvARB(mAttribute[index], v); } } + +void LLGLSLShader::setAlphaRange(F32 minimum, F32 maximum) +{ + uniform1f("minimum_alpha", minimum); + uniform1f("maximum_alpha", maximum); +} diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 621e0b82ee..558ea66b50 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -47,6 +47,7 @@ public: bool hasGamma; S32 mIndexedTextureChannels; bool disableTextureIndex; + bool hasAlphaMask; // char numLights; @@ -67,6 +68,8 @@ public: LLGLSLShader(); static GLhandleARB sCurBoundShader; + static LLGLSLShader* sCurBoundShaderPtr; + static bool sNoFixedFunction; void unload(); @@ -105,6 +108,8 @@ public: void uniformMatrix3fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v); void uniformMatrix4fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v); + void setAlphaRange(F32 minimum, F32 maximum); + void vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); void vertexAttrib4fv(U32 index, GLfloat* v); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 70df1dd1d1..d72918b15d 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1168,6 +1168,11 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) { flush(); + if (LLGLSLShader::sNoFixedFunction) + { //glAlphaFunc is deprecated in OpenGL 3.3 + return; + } + if (mCurrAlphaFunc != func || mCurrAlphaFuncVal != value) { @@ -1182,6 +1187,30 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) glAlphaFunc(sGLCompareFunc[func], value); } } + + if (gDebugGL) + { //make sure cached state is correct + GLint cur_func = 0; + glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur_func); + + if (func == CF_DEFAULT) + { + func = CF_GREATER; + } + + if (cur_func != sGLCompareFunc[func]) + { + llerrs << "Alpha test function corrupted!" << llendl; + } + + F32 ref = 0.f; + glGetFloatv(GL_ALPHA_TEST_REF, &ref); + + if (ref != value) + { + llerrs << "Alpha test value corrupted!" << llendl; + } + } } void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 751b250d96..986c1f2774 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -206,21 +206,40 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->hasLighting) { - if (features->hasWaterFog) { if (features->disableTextureIndex) { - if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl")) + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl")) + { + return FALSE; + } } } else { - if (!shader->attachObject("lighting/lightWaterF.glsl")) + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightWaterAlphaMaskF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightWaterF.glsl")) + { + return FALSE; + } } shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } @@ -230,16 +249,36 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { if (features->disableTextureIndex) { - if (!shader->attachObject("lighting/lightNonIndexedF.glsl")) + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightAlphaMaskNonIndexedF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightNonIndexedF.glsl")) + { + return FALSE; + } } } else { - if (!shader->attachObject("lighting/lightF.glsl")) + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightAlphaMaskF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightF.glsl")) + { + return FALSE; + } } shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } @@ -272,14 +311,28 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { if (features->disableTextureIndex) { - if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl")) + if (features->hasAlphaMask) + { + if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl")) { return FALSE; } } else { - if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) + if (features->hasAlphaMask) + { + if (!shader->attachObject("lighting/lightFullbrightWaterAlphaMaskF.glsl")) + { + return FALSE; + } + } + else if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) { return FALSE; } @@ -310,16 +363,37 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { if (features->disableTextureIndex) { - if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl")) + + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl")) + { + return FALSE; + } } } else { - if (!shader->attachObject("lighting/lightFullbrightF.glsl")) + if (features->hasAlphaMask) { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightAlphaMaskF.glsl")) + { + return FALSE; + } + } + else + { + if (!shader->attachObject("lighting/lightFullbrightF.glsl")) + { + return FALSE; + } } shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } @@ -406,7 +480,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) LL_DEBUGS("ShaderLoading") << log << LL_ENDL; } } -} + } GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl new file mode 100644 index 0000000000..338d0ebb2b --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -0,0 +1,30 @@ +/** + * @file diffuseF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +varying vec3 vary_normal; + +void main() +{ + vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(col.rgb, 0.0); + gl_FragData[1] = vec4(0,0,0,0); // spec + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl new file mode 100644 index 0000000000..0671cb94bd --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -0,0 +1,26 @@ +/** + * @file diffuseAlphaMaskIndexedF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +varying vec3 vary_normal; + +uniform float minimum_alpha; +uniform float maximum_alpha; + +void main() +{ + vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + + gl_FragData[0] = vec4(col.rgb, 0.0); + gl_FragData[1] = vec4(0,0,0,0); + vec3 nvn = normalize(vary_normal); + gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl new file mode 100644 index 0000000000..e24d0b666e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -0,0 +1,27 @@ +/** + * @file shadowAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +varying vec4 post_pos; + +void main() +{ + float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a; + + if (alpha < minimum_alpha || alpha > maximum_alpha) + { + discard; + } + + gl_FragColor = vec4(1,1,1,1); + + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl new file mode 100644 index 0000000000..58e9bcec58 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl @@ -0,0 +1,23 @@ +/** + * @file shadowAlphaMaskV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +varying vec4 post_pos; + +void main() +{ + //transform vertex + vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex; + + post_pos = pos; + + gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); + + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index e0c5406483..0bfe74ce42 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -7,13 +7,11 @@ -uniform sampler2D diffuseMap; - varying vec4 post_pos; void main() { - gl_FragColor = vec4(1,1,1,texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a); + gl_FragColor = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl index 9271a5115c..d40c2d9f78 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -17,7 +17,4 @@ void main() post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor = gl_Color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl new file mode 100644 index 0000000000..1211ad7a89 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl @@ -0,0 +1,30 @@ +/** + * @file lightAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +void default_lighting() +{ + vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl new file mode 100644 index 0000000000..1a7d67b943 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl @@ -0,0 +1,33 @@ +/** + * @file lightAlphaMaskNonIndexedF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +uniform float minimum_alpha; +uniform float maximum_alpha; + + +uniform sampler2D diffuseMap; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +void default_lighting() +{ + vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl new file mode 100644 index 0000000000..73e885a7e9 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl @@ -0,0 +1,29 @@ +/** + * @file lightFullbrightAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); + +void fullbright_lighting() +{ + vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = fullbrightAtmosTransport(color.rgb); + + color.rgb = fullbrightScaleSoftClip(color.rgb); + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl new file mode 100644 index 0000000000..55dfe9b166 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -0,0 +1,31 @@ +/** + * @file lightFullbrightNonIndexedAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); + +uniform sampler2D diffuseMap; + +void fullbright_lighting() +{ + vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = fullbrightAtmosTransport(color.rgb); + + color.rgb = fullbrightScaleSoftClip(color.rgb); + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl new file mode 100644 index 0000000000..e4cea077f9 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -0,0 +1,29 @@ +/** + * @file lightFullbrightWaterAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec4 diffuseLookup(vec2 texcoord); + +vec3 fullbrightAtmosTransport(vec3 light); +vec4 applyWaterFog(vec4 color); + +void fullbright_lighting_water() +{ + vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = fullbrightAtmosTransport(color.rgb); + + gl_FragColor = applyWaterFog(color); +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl new file mode 100644 index 0000000000..e8533f94a7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -0,0 +1,29 @@ +/** + * @file lightFullbrightWaterNonIndexedAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +vec3 fullbrightAtmosTransport(vec3 light); +vec4 applyWaterFog(vec4 color); + +void fullbright_lighting_water() +{ + vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = fullbrightAtmosTransport(color.rgb); + + gl_FragColor = applyWaterFog(color); +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl new file mode 100644 index 0000000000..7b3c20f092 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl @@ -0,0 +1,27 @@ +/** + * @file lightWaterAlphaMaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void default_lighting_water() +{ + vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = atmosLighting(color.rgb); + + gl_FragColor = applyWaterFog(color); +} + diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl new file mode 100644 index 0000000000..907140effd --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -0,0 +1,31 @@ +/** + * @file lightWaterAlphaMaskNonIndexedF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +uniform sampler2D diffuseMap; + +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void default_lighting_water() +{ + vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + color.rgb = atmosLighting(color.rgb); + + color = applyWaterFog(color); + + gl_FragColor = color; +} + diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ddcf42e523..9719140a37 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -88,16 +88,13 @@ void LLDrawPoolAlpha::endDeferredPass(S32 pass) void LLDrawPoolAlpha::renderDeferred(S32 pass) { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - { - LLFastTimer t(FTM_RENDER_GRASS); - gDeferredTreeProgram.bind(); - LLGLEnable test(GL_ALPHA_TEST); - //render alpha masked objects - LLRenderPass::renderTexture(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask()); - gDeferredTreeProgram.unbind(); - } - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + LLFastTimer t(FTM_RENDER_GRASS); + gDeferredDiffuseAlphaMaskProgram.bind(); + gDeferredDiffuseAlphaMaskProgram.setAlphaRange(0.33f, 1.f); + + //render alpha masked objects + LLRenderPass::pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); + gDeferredDiffuseAlphaMaskProgram.unbind(); } @@ -124,7 +121,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) if (pass == 0) { simple_shader = &gDeferredAlphaProgram; - fullbright_shader = &gObjectFullbrightProgram; + fullbright_shader = &gObjectFullbrightAlphaMaskProgram; //prime simple shader (loads shadow relevant uniforms) gPipeline.bindDeferredShader(*simple_shader); @@ -138,7 +135,8 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) gPipeline.mDeferredDepth.bindTarget(); simple_shader = NULL; fullbright_shader = NULL; - gObjectFullbrightProgram.bind(); + gObjectFullbrightAlphaMaskProgram.bind(); + gObjectFullbrightAlphaMaskProgram.setAlphaRange(0.33f, 1.f); } deferred_render = TRUE; @@ -157,7 +155,7 @@ void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) { gPipeline.mDeferredDepth.flush(); gPipeline.mScreen.bindTarget(); - gObjectFullbrightProgram.unbind(); + gObjectFullbrightAlphaMaskProgram.unbind(); } deferred_render = FALSE; @@ -175,13 +173,13 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) if (LLPipeline::sUnderWaterRender) { - simple_shader = &gObjectSimpleWaterProgram; - fullbright_shader = &gObjectFullbrightWaterProgram; + simple_shader = &gObjectSimpleWaterAlphaMaskProgram; + fullbright_shader = &gObjectFullbrightWaterAlphaMaskProgram; } else { - simple_shader = &gObjectSimpleProgram; - fullbright_shader = &gObjectFullbrightProgram; + simple_shader = &gObjectSimpleAlphaMaskProgram; + fullbright_shader = &gObjectFullbrightAlphaMaskProgram; } if (mVertexShaderLevel > 0) @@ -227,29 +225,32 @@ void LLDrawPoolAlpha::render(S32 pass) mAlphaDFactor = LLRender::BF_ZERO; // block (zero-out) glow where the alpha test succeeds gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); if (mVertexShaderLevel > 0) { - if (!LLPipeline::sRenderDeferred) + if (!LLPipeline::sRenderDeferred || !deferred_render) { simple_shader->bind(); + simple_shader->setAlphaRange(0.33f, 1.f); + pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); } if (fullbright_shader) { fullbright_shader->bind(); + fullbright_shader->setAlphaRange(0.33f, 1.f); } pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); //LLGLSLShader::bindNoShader(); } else { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); //OK gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask()); gPipeline.enableLightsDynamic(); pushBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask()); + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); //OK } - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy || @@ -257,7 +258,6 @@ void LLDrawPoolAlpha::render(S32 pass) if (deferred_render && pass == 1) { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.33f); gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); } else @@ -268,13 +268,33 @@ void LLDrawPoolAlpha::render(S32 pass) mAlphaDFactor = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; // } gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - if (LLPipeline::sImpostorRender) + if (mVertexShaderLevel > 0) { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + if (LLPipeline::sImpostorRender) + { + fullbright_shader->bind(); + fullbright_shader->setAlphaRange(0.5f, 1.f); + simple_shader->bind(); + simple_shader->setAlphaRange(0.5f, 1.f); + } + else + { + fullbright_shader->bind(); + fullbright_shader->setAlphaRange(0.f, 1.f); + simple_shader->bind(); + simple_shader->setAlphaRange(0.f, 1.f); + } } else { - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + if (LLPipeline::sImpostorRender) + { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); //OK + } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); //OK + } } } @@ -291,7 +311,6 @@ void LLDrawPoolAlpha::render(S32 pass) if (deferred_render && pass == 1) { - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.setSceneBlendType(LLRender::BT_ALPHA); } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9f790d03fe..694b7dcedd 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -258,7 +258,6 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() sSkipOpaque = TRUE; sShaderLevel = mVertexShaderLevel; sVertexProgram = &gDeferredAvatarAlphaProgram; - sRenderingSkinned = TRUE; gPipeline.bindDeferredShader(*sVertexProgram); @@ -361,7 +360,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) { gAvatarMatrixParam = sVertexProgram->mUniform[LLViewerShaderMgr::AVATAR_MATRIX]; } - gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); + //gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); glColor4f(1,1,1,1); @@ -605,16 +604,17 @@ void LLDrawPoolAvatar::beginRigid() { if (LLPipeline::sUnderWaterRender) { - sVertexProgram = &gObjectSimpleNonIndexedWaterProgram; + sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram; } else { - sVertexProgram = &gObjectSimpleNonIndexedProgram; + sVertexProgram = &gObjectAlphaMaskNonIndexedProgram; } if (sVertexProgram != NULL) { //eyeballs render with the specular shader sVertexProgram->bind(); + sVertexProgram->setAlphaRange(0.2f, 1.f); } } else @@ -692,11 +692,11 @@ void LLDrawPoolAvatar::beginSkinned() { if (LLPipeline::sUnderWaterRender) { - sVertexProgram = &gObjectSimpleNonIndexedWaterProgram; + sVertexProgram = &gObjectAlphaMaskNonIndexedWaterProgram; } else { - sVertexProgram = &gObjectSimpleNonIndexedProgram; + sVertexProgram = &gObjectAlphaMaskNonIndexedProgram; } } @@ -728,6 +728,11 @@ void LLDrawPoolAvatar::beginSkinned() sVertexProgram->bind(); } } + + if (LLGLSLShader::sNoFixedFunction) + { + sVertexProgram->setAlphaRange(0.2f, 1.f); + } } void LLDrawPoolAvatar::endSkinned() diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 224f149c6b..eec4ee6bac 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -182,7 +182,6 @@ void LLDrawPoolSimple::endRenderPass(S32 pass) void LLDrawPoolSimple::render(S32 pass) { LLGLDisable blend(GL_BLEND); - LLGLDisable alpha_test(GL_ALPHA_TEST); { //render simple LLFastTimer t(FTM_RENDER_SIMPLE); @@ -202,6 +201,7 @@ void LLDrawPoolSimple::render(S32 pass) } else { + LLGLDisable alpha_test(GL_ALPHA_TEST); renderTexture(LLRenderPass::PASS_SIMPLE, getVertexDataMask()); } @@ -256,19 +256,21 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass) if (LLPipeline::sUnderWaterRender) { - simple_shader = &gObjectSimpleNonIndexedWaterProgram; + simple_shader = &gObjectAlphaMaskNonIndexedWaterProgram; } else { - simple_shader = &gObjectSimpleNonIndexedProgram; + simple_shader = &gObjectAlphaMaskNonIndexedProgram; } if (mVertexShaderLevel > 0) { simple_shader->bind(); + simple_shader->setAlphaRange(0.5f, 1.f); } else { + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); // don't use shaders! if (gGLManager.mHasShaderObjects) { @@ -286,22 +288,23 @@ void LLDrawPoolGrass::endRenderPass(S32 pass) { simple_shader->unbind(); } + else + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } } void LLDrawPoolGrass::render(S32 pass) { LLGLDisable blend(GL_BLEND); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - + { LLFastTimer t(FTM_RENDER_GRASS); LLGLEnable test(GL_ALPHA_TEST); gGL.setSceneBlendType(LLRender::BT_ALPHA); //render grass LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask()); - } - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } } void LLDrawPoolGrass::beginDeferredPass(S32 pass) @@ -316,17 +319,13 @@ void LLDrawPoolGrass::endDeferredPass(S32 pass) void LLDrawPoolGrass::renderDeferred(S32 pass) { - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - { LLFastTimer t(FTM_RENDER_GRASS_DEFERRED); - gDeferredTreeProgram.bind(); - LLGLEnable test(GL_ALPHA_TEST); + gDeferredNonIndexedDiffuseAlphaMaskProgram.bind(); + gDeferredNonIndexedDiffuseAlphaMaskProgram.setAlphaRange(0.5f, 1.f); //render grass LLRenderPass::renderTexture(LLRenderPass::PASS_GRASS, getVertexDataMask()); } - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 429e06b227..a6e0151114 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -62,24 +62,25 @@ void LLDrawPoolTree::prerender() void LLDrawPoolTree::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); - + if (LLPipeline::sUnderWaterRender) { - shader = &gObjectSimpleNonIndexedWaterProgram; + shader = &gObjectAlphaMaskNonIndexedWaterProgram; } else { - shader = &gObjectSimpleNonIndexedProgram; + shader = &gObjectAlphaMaskNonIndexedProgram; } if (gPipeline.canUseVertexShaders()) { shader->bind(); + shader->setAlphaRange(0.5f, 1.f); } else { gPipeline.enableLightsDynamic(); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } } @@ -92,7 +93,7 @@ void LLDrawPoolTree::render(S32 pass) return; } - LLGLEnable test(GL_ALPHA_TEST); + LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); if (gSavedSettings.getBOOL("RenderAnimateTrees")) @@ -121,12 +122,16 @@ void LLDrawPoolTree::render(S32 pass) void LLDrawPoolTree::endRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + if (gPipeline.canUseWindLightShadersOnObjects()) { shader->unbind(); } + + if (mVertexShaderLevel <= 0) + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } } //============================================ @@ -135,10 +140,10 @@ void LLDrawPoolTree::endRenderPass(S32 pass) void LLDrawPoolTree::beginDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - shader = &gDeferredTreeProgram; + shader = &gDeferredNonIndexedDiffuseAlphaMaskProgram; shader->bind(); + shader->setAlphaRange(0.5f, 1.f); } void LLDrawPoolTree::renderDeferred(S32 pass) @@ -149,8 +154,7 @@ void LLDrawPoolTree::renderDeferred(S32 pass) void LLDrawPoolTree::endDeferredPass(S32 pass) { LLFastTimer t(FTM_RENDER_TREES); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + shader->unbind(); } @@ -160,11 +164,12 @@ void LLDrawPoolTree::endDeferredPass(S32 pass) void LLDrawPoolTree::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"), gSavedSettings.getF32("RenderDeferredTreeShadowBias")); - gDeferredShadowProgram.bind(); + gDeferredShadowAlphaMaskProgram.bind(); + gDeferredShadowAlphaMaskProgram.setAlphaRange(0.5f, 1.f); } void LLDrawPoolTree::renderShadow(S32 pass) @@ -175,12 +180,9 @@ void LLDrawPoolTree::renderShadow(S32 pass) void LLDrawPoolTree::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"), gSavedSettings.getF32("RenderDeferredSpotShadowBias")); - - //gDeferredShadowProgram.unbind(); } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index a219386b53..79a835fd14 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -233,8 +233,7 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const { LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ALPHA); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - + gGL.getTexUnit(0)->bind(sCloudNoiseTexture); cloud_shader->bind(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8fa4065fa6..26b2b0f5c3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5123,7 +5123,6 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.getTexUnit(0)->bind(mSilhouetteImagep); LLGLSPipelineSelection gls_select; - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); LLGLEnable blend(GL_BLEND); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); @@ -5250,7 +5249,6 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } void LLSelectMgr::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point) diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 252183b6d7..12f6a0dd1c 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -120,8 +120,8 @@ // Library includes from llvfs #include "lldir.h" - -// Library includes from llmessage project + +// Library includes from llmessage project #include "llcachename.h" #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 62d83b516f..fa8d43e0b2 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -70,8 +70,12 @@ LLGLSLShader gTwoTextureAddProgram; //object shaders LLGLSLShader gObjectSimpleProgram; LLGLSLShader gObjectSimpleWaterProgram; +LLGLSLShader gObjectSimpleAlphaMaskProgram; +LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; LLGLSLShader gObjectFullbrightProgram; LLGLSLShader gObjectFullbrightWaterProgram; +LLGLSLShader gObjectFullbrightAlphaMaskProgram; +LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; LLGLSLShader gObjectFullbrightShinyProgram; LLGLSLShader gObjectFullbrightShinyWaterProgram; LLGLSLShader gObjectShinyProgram; @@ -80,6 +84,8 @@ LLGLSLShader gObjectBumpProgram; LLGLSLShader gObjectSimpleNonIndexedProgram; LLGLSLShader gObjectSimpleNonIndexedWaterProgram; +LLGLSLShader gObjectAlphaMaskNonIndexedProgram; +LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; LLGLSLShader gObjectFullbrightNonIndexedProgram; LLGLSLShader gObjectFullbrightNonIndexedWaterProgram; LLGLSLShader gObjectFullbrightShinyNonIndexedProgram; @@ -128,7 +134,9 @@ LLGLSLShader gDeferredImpostorProgram; LLGLSLShader gDeferredEdgeProgram; LLGLSLShader gDeferredWaterProgram; LLGLSLShader gDeferredDiffuseProgram; +LLGLSLShader gDeferredDiffuseAlphaMaskProgram; LLGLSLShader gDeferredNonIndexedDiffuseProgram; +LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredSkinnedBumpProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; @@ -145,6 +153,7 @@ LLGLSLShader gDeferredSunProgram; LLGLSLShader gDeferredBlurLightProgram; LLGLSLShader gDeferredSoftenProgram; LLGLSLShader gDeferredShadowProgram; +LLGLSLShader gDeferredShadowAlphaMaskProgram; LLGLSLShader gDeferredAvatarShadowProgram; LLGLSLShader gDeferredAttachmentShadowProgram; LLGLSLShader gDeferredAlphaProgram; @@ -177,6 +186,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gObjectSimpleAlphaMaskProgram); mShaderList.push_back(&gObjectBumpProgram); mShaderList.push_back(&gUIProgram); mShaderList.push_back(&gCustomAlphaProgram); @@ -185,10 +195,13 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gSolidColorProgram); mShaderList.push_back(&gOcclusionProgram); mShaderList.push_back(&gObjectFullbrightProgram); + mShaderList.push_back(&gObjectFullbrightAlphaMaskProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gObjectFullbrightShinyWaterProgram); mShaderList.push_back(&gObjectSimpleNonIndexedProgram); mShaderList.push_back(&gObjectSimpleNonIndexedWaterProgram); + mShaderList.push_back(&gObjectAlphaMaskNonIndexedProgram); + mShaderList.push_back(&gObjectAlphaMaskNonIndexedWaterProgram); mShaderList.push_back(&gObjectFullbrightNonIndexedProgram); mShaderList.push_back(&gObjectFullbrightNonIndexedWaterProgram); mShaderList.push_back(&gObjectFullbrightShinyNonIndexedProgram); @@ -205,6 +218,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gTerrainWaterProgram); mShaderList.push_back(&gObjectSimpleWaterProgram); mShaderList.push_back(&gObjectFullbrightWaterProgram); + mShaderList.push_back(&gObjectSimpleWaterAlphaMaskProgram); + mShaderList.push_back(&gObjectFullbrightWaterAlphaMaskProgram); mShaderList.push_back(&gAvatarWaterProgram); mShaderList.push_back(&gObjectShinyWaterProgram); mShaderList.push_back(&gObjectShinyNonIndexedWaterProgram); @@ -623,10 +638,14 @@ void LLViewerShaderMgr::unloadShaders() gSolidColorProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); + gObjectSimpleWaterAlphaMaskProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); + gObjectFullbrightAlphaMaskProgram.unload(); + gObjectFullbrightWaterAlphaMaskProgram.unload(); gObjectShinyProgram.unload(); gObjectFullbrightShinyProgram.unload(); @@ -635,6 +654,8 @@ void LLViewerShaderMgr::unloadShaders() gObjectSimpleNonIndexedProgram.unload(); gObjectSimpleNonIndexedWaterProgram.unload(); + gObjectAlphaMaskNonIndexedProgram.unload(); + gObjectAlphaMaskNonIndexedWaterProgram.unload(); gObjectFullbrightNonIndexedProgram.unload(); gObjectFullbrightNonIndexedWaterProgram.unload(); @@ -673,6 +694,8 @@ void LLViewerShaderMgr::unloadShaders() gPostNightVisionProgram.unload(); gDeferredDiffuseProgram.unload(); + gDeferredDiffuseAlphaMaskProgram.unload(); + gDeferredNonIndexedDiffuseAlphaMaskProgram.unload(); gDeferredNonIndexedDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); @@ -766,17 +789,25 @@ BOOL LLViewerShaderMgr::loadBasicShaders() index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/transportF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "environment/waterFogF.glsl", mVertexShaderLevel[SHADER_WATER] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightAlphaMaskNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightNonIndexedAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightWaterAlphaMaskNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightShinyNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightShinyNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightShinyWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightWaterAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightWaterAlphaMaskF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); @@ -1022,6 +1053,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredTreeProgram.unload(); gDeferredDiffuseProgram.unload(); + gDeferredDiffuseAlphaMaskProgram.unload(); + gDeferredNonIndexedDiffuseAlphaMaskProgram.unload(); gDeferredNonIndexedDiffuseProgram.unload(); gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); @@ -1037,6 +1070,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBlurLightProgram.unload(); gDeferredSoftenProgram.unload(); gDeferredShadowProgram.unload(); + gDeferredShadowAlphaMaskProgram.unload(); gDeferredAvatarShadowProgram.unload(); gDeferredAttachmentShadowProgram.unload(); gDeferredAvatarProgram.unload(); @@ -1075,6 +1109,27 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredDiffuseProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredDiffuseAlphaMaskProgram.mName = "Deferred Diffuse Alpha Mask Shader"; + gDeferredDiffuseAlphaMaskProgram.mShaderFiles.clear(); + gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredNonIndexedDiffuseAlphaMaskProgram.mName = "Deferred Diffuse Non-Indexed Alpha Mask Shader"; + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.clear(); + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL); + } + if (success) { gDeferredNonIndexedDiffuseProgram.mName = "Non Indexed Deferred Diffuse Shader"; @@ -1399,6 +1454,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredShadowProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredShadowAlphaMaskProgram.mName = "Deferred Shadow Alpha Mask Shader"; + gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); + gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); + } + if (success) { gDeferredAvatarShadowProgram.mName = "Deferred Avatar Shadow Shader"; @@ -1613,16 +1678,22 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.unload(); gObjectShinyWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); + gObjectSimpleWaterAlphaMaskProgram.unload(); gObjectFullbrightProgram.unload(); + gObjectFullbrightAlphaMaskProgram.unload(); gObjectFullbrightWaterProgram.unload(); + gObjectFullbrightWaterAlphaMaskProgram.unload(); gObjectShinyNonIndexedProgram.unload(); gObjectFullbrightShinyNonIndexedProgram.unload(); gObjectFullbrightShinyNonIndexedWaterProgram.unload(); gObjectShinyNonIndexedWaterProgram.unload(); gObjectSimpleNonIndexedProgram.unload(); gObjectSimpleNonIndexedWaterProgram.unload(); + gObjectAlphaMaskNonIndexedProgram.unload(); + gObjectAlphaMaskNonIndexedWaterProgram.unload(); gObjectFullbrightNonIndexedProgram.unload(); gObjectFullbrightNonIndexedWaterProgram.unload(); gSkinnedObjectSimpleProgram.unload(); @@ -1670,6 +1741,41 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectSimpleNonIndexedWaterProgram.createShader(NULL, NULL); } + if (success) + { + gObjectAlphaMaskNonIndexedProgram.mName = "Non indexed alpha mask Shader"; + gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesLighting = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesAtmospherics = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.hasGamma = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAtmospherics = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.hasLighting = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.disableTextureIndex = true; + gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAlphaMask = true; + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.clear(); + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectAlphaMaskNonIndexedWaterProgram.mName = "Non indexed alpha mask Water Shader"; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.calculatesLighting = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.calculatesAtmospherics = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasWaterFog = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAtmospherics = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasLighting = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.disableTextureIndex = true; + gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAlphaMask = true; + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.clear(); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(NULL, NULL); + } + if (success) { gObjectFullbrightNonIndexedProgram.mName = "Non Indexed Fullbright Shader"; @@ -1783,6 +1889,23 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectSimpleProgram.createShader(NULL, NULL); } + + if (success) + { + gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; + gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); + } if (success) { @@ -1817,6 +1940,24 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectSimpleWaterProgram.createShader(NULL, NULL); } + if (success) + { + gObjectSimpleWaterAlphaMaskProgram.mName = "Simple Water Alpha Mask Shader"; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.calculatesLighting = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasWaterFog = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasLighting = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.clear(); + gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleWaterAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectSimpleWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectSimpleWaterAlphaMaskProgram.createShader(NULL, NULL); + } + if (success) { gObjectFullbrightProgram.mName = "Fullbright Shader"; @@ -1848,6 +1989,39 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectFullbrightWaterProgram.createShader(NULL, NULL); } + if (success) + { + gObjectFullbrightAlphaMaskProgram.mName = "Fullbright Alpha Mask Shader"; + gObjectFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectFullbrightAlphaMaskProgram.mFeatures.hasGamma = true; + gObjectFullbrightAlphaMaskProgram.mFeatures.hasTransport = true; + gObjectFullbrightAlphaMaskProgram.mFeatures.isFullbright = true; + gObjectFullbrightAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectFullbrightAlphaMaskProgram.mShaderFiles.clear(); + gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectFullbrightAlphaMaskProgram.createShader(NULL, NULL); + } + + if (success) + { + gObjectFullbrightWaterAlphaMaskProgram.mName = "Fullbright Water Shader"; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.isFullbright = true; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasWaterFog = true; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasTransport = true; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; + gObjectFullbrightWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; + gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.clear(); + gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightWaterAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + gObjectFullbrightWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; + success = gObjectFullbrightWaterAlphaMaskProgram.createShader(NULL, NULL); + } + if (success) { gObjectShinyProgram.mName = "Shiny Shader"; @@ -2092,6 +2266,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mFeatures.hasGamma = true; gAvatarProgram.mFeatures.hasAtmospherics = true; gAvatarProgram.mFeatures.hasLighting = true; + gAvatarProgram.mFeatures.hasAlphaMask = true; gAvatarProgram.mFeatures.disableTextureIndex = true; gAvatarProgram.mShaderFiles.clear(); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2108,6 +2283,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarWaterProgram.mFeatures.hasWaterFog = true; gAvatarWaterProgram.mFeatures.hasAtmospherics = true; gAvatarWaterProgram.mFeatures.hasLighting = true; + gAvatarWaterProgram.mFeatures.hasAlphaMask = true; gAvatarWaterProgram.mFeatures.disableTextureIndex = true; gAvatarWaterProgram.mShaderFiles.clear(); gAvatarWaterProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2146,6 +2322,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarEyeballProgram.mFeatures.hasGamma = true; gAvatarEyeballProgram.mFeatures.hasAtmospherics = true; gAvatarEyeballProgram.mFeatures.hasLighting = true; + gAvatarEyeballProgram.mFeatures.hasAlphaMask = true; gAvatarEyeballProgram.mFeatures.disableTextureIndex = true; gAvatarEyeballProgram.mShaderFiles.clear(); gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER_ARB)); diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 93a0ecc4f0..629ef32adb 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -297,11 +297,17 @@ extern LLGLSLShader gTwoTextureAddProgram; //object shaders extern LLGLSLShader gObjectSimpleProgram; +extern LLGLSLShader gObjectSimpleAlphaMaskProgram; extern LLGLSLShader gObjectSimpleWaterProgram; +extern LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; extern LLGLSLShader gObjectSimpleNonIndexedProgram; extern LLGLSLShader gObjectSimpleNonIndexedWaterProgram; +extern LLGLSLShader gObjectAlphaMaskNonIndexedProgram; +extern LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; extern LLGLSLShader gObjectFullbrightProgram; extern LLGLSLShader gObjectFullbrightWaterProgram; +extern LLGLSLShader gObjectFullbrightAlphaMaskProgram; +extern LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; extern LLGLSLShader gObjectFullbrightNonIndexedProgram; extern LLGLSLShader gObjectFullbrightNonIndexedWaterProgram; extern LLGLSLShader gObjectBumpProgram; @@ -359,6 +365,8 @@ extern LLGLSLShader gDeferredImpostorProgram; extern LLGLSLShader gDeferredEdgeProgram; extern LLGLSLShader gDeferredWaterProgram; extern LLGLSLShader gDeferredDiffuseProgram; +extern LLGLSLShader gDeferredDiffuseAlphaMaskProgram; +extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; extern LLGLSLShader gDeferredNonIndexedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedBumpProgram; @@ -377,6 +385,7 @@ extern LLGLSLShader gDeferredBlurLightProgram; extern LLGLSLShader gDeferredAvatarProgram; extern LLGLSLShader gDeferredSoftenProgram; extern LLGLSLShader gDeferredShadowProgram; +extern LLGLSLShader gDeferredShadowAlphaMaskProgram; extern LLGLSLShader gDeferredPostGIProgram; extern LLGLSLShader gDeferredPostProgram; extern LLGLSLShader gDeferredPostNoDoFProgram; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3f98df9eb9..2a4a5d7c47 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4219,7 +4219,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) bool should_alpha_mask = shouldAlphaMask(); LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - if (should_alpha_mask) + if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction) { gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } @@ -4248,7 +4248,10 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) } } - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction) + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender) { @@ -4331,7 +4334,7 @@ U32 LLVOAvatar::renderRigid() bool should_alpha_mask = shouldAlphaMask(); LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - if (should_alpha_mask) + if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction) { gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } @@ -4342,7 +4345,10 @@ U32 LLVOAvatar::renderRigid() num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); } - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + if (should_alpha_mask && !LLGLSLShader::sNoFixedFunction) + { + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + } return num_indices; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index dfcc7396ba..c3a90a4c62 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3669,6 +3669,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); + LLGLSLShader::bindNoShader(); doOcclusion(camera); } @@ -3734,6 +3735,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); + LLGLSLShader::bindNoShader(); doOcclusion(camera); } } @@ -3931,6 +3933,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); + LLGLSLShader::bindNoShader(); doOcclusion(camera); gGL.setColorMask(true, false); } @@ -3996,6 +3999,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) occlude = FALSE; gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); + LLGLSLShader::bindNoShader(); doOcclusion(camera); gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); @@ -6236,7 +6240,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGlowExtractProgram.uniform1f("warmthAmount", warmthAmount); LLGLEnable blend_on(GL_BLEND); LLGLEnable test(GL_ALPHA_TEST); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); mScreen.bindTexture(0, 0); @@ -8306,7 +8310,6 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gOcclusionProgram.bind(); } LLFastTimer ftm(FTM_SHADOW_SIMPLE); - LLGLDisable test(GL_ALPHA_TEST); gGL.getTexUnit(0)->disable(); for (U32 i = 0; i < sizeof(types)/sizeof(U32); ++i) { @@ -8332,12 +8335,11 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera { LLFastTimer ftm(FTM_SHADOW_ALPHA); - LLGLEnable test(GL_ALPHA_TEST); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.6f); + gDeferredShadowAlphaMaskProgram.bind(); + gDeferredShadowAlphaMaskProgram.setAlphaRange(0.6f, 1.f); renderObjects(LLRenderPass::PASS_ALPHA_SHADOW, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, TRUE); glColor4f(1,1,1,1); renderObjects(LLRenderPass::PASS_GRASS, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, TRUE); - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } //glCullFace(GL_BACK); @@ -8822,6 +8824,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_VOIDWATER, LLPipeline::RENDER_TYPE_PASS_ALPHA_SHADOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_PASS_SIMPLE, LLPipeline::RENDER_TYPE_PASS_BUMP, LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, -- cgit v1.2.3 From 13e152c92d0bd1bf224a67d64d0c747b8d28e426 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 3 Aug 2011 14:54:53 -0600 Subject: fix for SH-2177: Second Life Crashes On Startup in Advanced Mode -- I have reinstalled SL, Clear Caches -- Nothing Works --- indra/llwindow/llwindowwin32.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 551d487cc8..1239e2d40b 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1172,8 +1172,39 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO // First we try and get a 32 bit depth pixel format BOOL result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + + while(!result && mFSAASamples > 0) + { + llwarns << "FSAASamples: " << mFSAASamples << " not supported." << llendl ; + + mFSAASamples /= 2 ; //try to decrease sample pixel number until to disable anti-aliasing + if(mFSAASamples < 2) + { + mFSAASamples = 0 ; + } + + if (mFSAASamples > 0) + { + attrib_list[end_attrib + 3] = mFSAASamples; + } + else + { + cur_attrib = end_attrib ; + end_attrib = 0 ; + attrib_list[cur_attrib++] = 0 ; //end + } + result = wglChoosePixelFormatARB(mhDC, attrib_list, NULL, 256, pixel_formats, &num_formats); + + if(result) + { + llwarns << "Only support FSAASamples: " << mFSAASamples << llendl ; + } + } + if (!result) { + llwarns << "mFSAASamples: " << mFSAASamples << llendl ; + close(); show_window_creation_error("Error after wglChoosePixelFormatARB 32-bit"); return FALSE; -- cgit v1.2.3 From 5e22062b68d2392d465503b3954cf06001eda608 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 5 Aug 2011 16:02:05 -0600 Subject: fix for SH-2215: [crashhunters] crash at LLPluginClassMedia --- indra/llplugin/llpluginclassmedia.h | 6 +++--- indra/llplugin/llplugininstance.h | 2 +- indra/llplugin/llpluginmessagepipe.h | 3 ++- indra/llplugin/llpluginprocessparent.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index f8ed89f644..ade88a5623 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -41,16 +41,16 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner LOG_CLASS(LLPluginClassMedia); public: LLPluginClassMedia(LLPluginClassMediaOwner *owner); - virtual ~LLPluginClassMedia(); + ~LLPluginClassMedia(); // local initialization, called by the media manager when creating a source - virtual bool init(const std::string &launcher_filename, + bool init(const std::string &launcher_filename, const std::string &plugin_dir, const std::string &plugin_filename, bool debug); // undoes everything init() didm called by the media manager when destroying a source - virtual void reset(); + void reset(); void idle(void); diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h index e6926c3e37..3643a15d8c 100644 --- a/indra/llplugin/llplugininstance.h +++ b/indra/llplugin/llplugininstance.h @@ -39,7 +39,7 @@ class LLPluginInstanceMessageListener { public: - virtual ~LLPluginInstanceMessageListener(); + ~LLPluginInstanceMessageListener(); /** Plugin receives message from plugin loader shell. */ virtual void receivePluginMessage(const std::string &message) = 0; }; diff --git a/indra/llplugin/llpluginmessagepipe.h b/indra/llplugin/llpluginmessagepipe.h index 627577beb1..beb942c0fe 100644 --- a/indra/llplugin/llpluginmessagepipe.h +++ b/indra/llplugin/llpluginmessagepipe.h @@ -40,7 +40,8 @@ class LLPluginMessagePipeOwner LOG_CLASS(LLPluginMessagePipeOwner); public: LLPluginMessagePipeOwner(); - virtual ~LLPluginMessagePipeOwner(); + ~LLPluginMessagePipeOwner(); + // called with incoming messages virtual void receiveMessageRaw(const std::string &message) = 0; // called when the socket has an error diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index c66723f175..26c6b0c402 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -41,7 +41,7 @@ class LLPluginProcessParentOwner { public: - virtual ~LLPluginProcessParentOwner(); + ~LLPluginProcessParentOwner(); virtual void receivePluginMessage(const LLPluginMessage &message) = 0; virtual bool receivePluginMessageEarly(const LLPluginMessage &message) {return false;}; // This will only be called when the plugin has died unexpectedly -- cgit v1.2.3 From 17f46868d28876b65adcf24a45e6c19a20f2834c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 10 Aug 2011 14:40:39 -0500 Subject: SH-2265 Fix for impostor alpha masking being broken. --- .../shaders/class1/deferred/impostorF.glsl | 8 +++++++ .../shaders/class1/objects/impostorF.glsl | 26 ++++++++++++++++++++++ .../shaders/class1/objects/impostorV.glsl | 16 +++++++++++++ indra/newview/lldrawpoolavatar.cpp | 11 +++++++++ indra/newview/llviewershadermgr.cpp | 15 +++++++++++++ indra/newview/llviewershadermgr.h | 1 + 6 files changed, 77 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/objects/impostorF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/objects/impostorV.glsl (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index fa811f0d55..75f594ed8f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -5,6 +5,8 @@ * $/LicenseInfo$ */ +uniform float minimum_alpha; +uniform float maximum_alpha; uniform sampler2D diffuseMap; @@ -14,6 +16,12 @@ uniform sampler2D specularMap; void main() { vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); + + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + gl_FragData[0] = vec4(col.rgb, col.a * 0.005); gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl new file mode 100644 index 0000000000..7257132f06 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -0,0 +1,26 @@ +/** + * @file impostorF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); + +uniform sampler2D diffuseMap; + +void main() +{ + vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + gl_FragColor = color; +} diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl new file mode 100644 index 0000000000..724b86a1b7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl @@ -0,0 +1,16 @@ +/** + * @file impostorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +void main() +{ + //transform vertex + gl_Position = ftransform(); + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 694b7dcedd..28e464b60d 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -589,12 +589,22 @@ void LLDrawPoolAvatar::beginImpostor() LLVOAvatar::sNumVisibleAvatars = 0; } + if (LLGLSLShader::sNoFixedFunction) + { + gImpostorProgram.bind(); + gImpostorProgram.setAlphaRange(0.01f, 1.f); + } + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); sDiffuseChannel = 0; } void LLDrawPoolAvatar::endImpostor() { + if (LLGLSLShader::sNoFixedFunction) + { + gImpostorProgram.unbind(); + } gPipeline.enableLightsDynamic(); } @@ -647,6 +657,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); + sVertexProgram->setAlphaRange(0.01f, 1.f); } void LLDrawPoolAvatar::endDeferredImpostor() diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index fa8d43e0b2..36106752a2 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -118,6 +118,7 @@ LLGLSLShader gAvatarProgram; LLGLSLShader gAvatarWaterProgram; LLGLSLShader gAvatarEyeballProgram; LLGLSLShader gAvatarPickProgram; +LLGLSLShader gImpostorProgram; // WindLight shader handles LLGLSLShader gWLSkyProgram; @@ -186,6 +187,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gImpostorProgram); mShaderList.push_back(&gObjectSimpleAlphaMaskProgram); mShaderList.push_back(&gObjectBumpProgram); mShaderList.push_back(&gUIProgram); @@ -638,6 +640,7 @@ void LLViewerShaderMgr::unloadShaders() gSolidColorProgram.unload(); gObjectSimpleProgram.unload(); + gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); @@ -1678,6 +1681,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.unload(); gObjectShinyWaterProgram.unload(); gObjectSimpleProgram.unload(); + gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); @@ -1874,6 +1878,17 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectFullbrightShinyNonIndexedWaterProgram.createShader(NULL, &mShinyUniforms); } + if (success) + { + gImpostorProgram.mName = "Impostor Shader"; + gImpostorProgram.mFeatures.disableTextureIndex = true; + gImpostorProgram.mShaderFiles.clear(); + gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER_ARB)); + gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gImpostorProgram.createShader(NULL, NULL); + } + if (success) { gObjectSimpleProgram.mName = "Simple Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 629ef32adb..d4040f11e1 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -351,6 +351,7 @@ extern LLGLSLShader gAvatarProgram; extern LLGLSLShader gAvatarWaterProgram; extern LLGLSLShader gAvatarEyeballProgram; extern LLGLSLShader gAvatarPickProgram; +extern LLGLSLShader gImpostorProgram; // WindLight shader handles extern LLGLSLShader gWLSkyProgram; -- cgit v1.2.3 From 610764fbfce75f54c95d4b10c2a8f9482a7a7b80 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 11 Aug 2011 12:49:05 -0500 Subject: SH-2181 Fix for occlusion culling going bonkers when ban lines are present. --- .../shaders/class1/objects/impostorF.glsl | 38 +++++++++++----------- indra/newview/llglsandbox.cpp | 2 +- indra/newview/pipeline.cpp | 21 +++++++----- 3 files changed, 32 insertions(+), 29 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index 7257132f06..13597ee439 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -5,22 +5,22 @@ * $/LicenseInfo$ */ -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -uniform sampler2D diffuseMap; - -void main() -{ - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - gl_FragColor = color; -} +uniform float minimum_alpha; +uniform float maximum_alpha; + +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); + +uniform sampler2D diffuseMap; + +void main() +{ + vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + + if (color.a < minimum_alpha || color.a > maximum_alpha) + { + discard; + } + + gl_FragColor = color; +} diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 842911ecc0..fa3f546157 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -620,7 +620,7 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV F32 pos_y = pos.mV[VY]; LLGLSUIDefault gls_ui; - LLGLDepthTest gls_depth(GL_TRUE); + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLGLDisable cull(GL_CULL_FACE); if (mCollisionBanned == BA_BANNED) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 01ff1bb16f..7a26404138 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3340,13 +3340,15 @@ void render_hud_elements() glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); gGL.color4f(1,1,1,1); - if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + + if (LLGLSLShader::sNoFixedFunction) { - if (LLGLSLShader::sNoFixedFunction) - { - gUIProgram.bind(); - } + gUIProgram.bind(); + } + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() @@ -3360,10 +3362,6 @@ void render_hud_elements() // Render name tags. LLHUDObject::renderAll(); - if (LLGLSLShader::sNoFixedFunction) - { - gUIProgram.unbind(); - } } else if (gForceRenderLandFence) { @@ -3374,6 +3372,11 @@ void render_hud_elements() { LLHUDText::renderAllHUD(); } + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } gGL.flush(); } -- cgit v1.2.3 From 729a8d1a7698777ef90340f49aee2c85bd34711b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 12 Aug 2011 16:39:15 +0300 Subject: STORM-1554 FIXED Fixed typo in a gesture name. --- indra/newview/llviewerinventory.cpp | 2 +- indra/newview/skins/default/xui/en/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b22c6d2fd4..ad65a8846c 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -141,7 +141,7 @@ public: mInventoryItemsDict["Female - Wow"] = LLTrans::getString("Female - Wow"); //common - mInventoryItemsDict["/bow"] = LLTrans::getString("/bow"); + mInventoryItemsDict["/bow1"] = LLTrans::getString("/bow1"); mInventoryItemsDict["/clap"] = LLTrans::getString("/clap"); mInventoryItemsDict["/count"] = LLTrans::getString("/count"); mInventoryItemsDict["/extinguish"] = LLTrans::getString("/extinguish"); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f049f857f0..2094275bed 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3414,7 +3414,7 @@ Abuse Report Female - Stick tougue out Female - Wow - /bow + /bow1 /clap /count /extinguish -- cgit v1.2.3 From 3c8f1dac14aa86025b5ab8eb53cbc302184015b5 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 15 Aug 2011 19:01:28 +0300 Subject: STORM-782 FIXED Removing the useless 'Compress snapshots to disk' item from the Advanced menu. Removing the corresponding setting as well because it's not used anywhere. --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/skins/default/xui/da/menu_viewer.xml | 1 - indra/newview/skins/default/xui/de/menu_viewer.xml | 1 - indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ---------- indra/newview/skins/default/xui/es/menu_viewer.xml | 1 - indra/newview/skins/default/xui/fr/menu_viewer.xml | 1 - indra/newview/skins/default/xui/it/menu_viewer.xml | 1 - indra/newview/skins/default/xui/ja/menu_viewer.xml | 1 - indra/newview/skins/default/xui/pl/menu_viewer.xml | 1 - indra/newview/skins/default/xui/pt/menu_viewer.xml | 1 - indra/newview/skins/default/xui/zh/menu_viewer.xml | 1 - 11 files changed, 30 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 01842d1037..86099aadfb 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1629,17 +1629,6 @@ - CompressSnapshotsToDisk - - Comment - Compress snapshots saved to disk (Using JPEG 2000) - Persist - 1 - Type - Boolean - Value - 0 - ConnectAsGod Comment diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml index d352312d15..c2f7d26dc9 100644 --- a/indra/newview/skins/default/xui/da/menu_viewer.xml +++ b/indra/newview/skins/default/xui/da/menu_viewer.xml @@ -140,7 +140,6 @@ - diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index de4c269be6..e010844206 100644 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 01699955a6..b08e3abb71 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1250,16 +1250,6 @@ function="ToggleControl" parameter="QuietSnapshotsToDisk" /> - - - - diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index 049a89aa06..b0d16d1ca4 100644 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index ccea1e4570..46adc79a00 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml index daeda576cc..ef40cbda7c 100644 --- a/indra/newview/skins/default/xui/it/menu_viewer.xml +++ b/indra/newview/skins/default/xui/it/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index 09b315b026..223c1e1f11 100644 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml index e869806d04..fe4662c5a2 100644 --- a/indra/newview/skins/default/xui/pl/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml @@ -138,7 +138,6 @@ - diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml index c184fb0af3..ea54afed5e 100644 --- a/indra/newview/skins/default/xui/pt/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml @@ -159,7 +159,6 @@ - diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index 6d70ac4c1f..02782ad6bd 100644 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -139,7 +139,6 @@ - -- cgit v1.2.3 From 73025e27719927ec72eddc6e111ae782b1faf0ae Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 15 Aug 2011 22:22:31 +0300 Subject: STORM-1041 FIXED "Remove all clothes" item of the avatar menu didn't actually remove all clothes. I haven't investigated what the problem was, I've just rewritten the (ancient?) removal code in the way we take off items in other places, i.e. by removing them from the Current Outfit forder. --- indra/newview/llagentwearables.cpp | 31 ----------------------------- indra/newview/llagentwearables.h | 2 -- indra/newview/llinventorybridge.cpp | 39 ++++++++++++++----------------------- 3 files changed, 15 insertions(+), 57 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 36272f0c7c..b9125ec8d3 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1692,37 +1692,6 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty } } -// static -void LLAgentWearables::userRemoveAllClothes() -{ - // We have to do this up front to avoid having to deal with the case of multiple wearables being dirty. - if (gAgentCamera.cameraCustomizeAvatar()) - { - // switching to outfit editor should automagically save any currently edited wearable - LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); - } - userRemoveAllClothesStep2(TRUE); -} - -// static -void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) -{ - if (proceed) - { - gAgentWearables.removeWearable(LLWearableType::WT_SHIRT,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_PANTS,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_SHOES,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_SOCKS,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_JACKET,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_GLOVES,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_UNDERSHIRT,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_UNDERPANTS,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_SKIRT,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_ALPHA,true,0); - gAgentWearables.removeWearable(LLWearableType::WT_TATTOO,true,0); - } -} - // Combines userRemoveAllAttachments() and userAttachMultipleAttachments() logic to // get attachments into desired state with minimal number of adds/removes. void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 3ef50f14da..252b812c27 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -165,7 +165,6 @@ private: void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); protected: static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); - static void userRemoveAllClothesStep2(BOOL proceed); // userdata is NULL //-------------------------------------------------------------------- // Server Communication @@ -211,7 +210,6 @@ public: public: static void userRemoveWearable(const LLWearableType::EType &type, const U32 &index); static void userRemoveWearablesOfType(const LLWearableType::EType &type); - static void userRemoveAllClothes(); typedef std::vector llvo_vec_t; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ff328fd071..f0fc710f3d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4925,31 +4925,22 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, // static void LLWearableBridge::removeAllClothesFromAvatar() { - // Remove COF links. - for (S32 itype = LLWearableType::WT_SHAPE; itype < LLWearableType::WT_COUNT; ++itype) - { - if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES) - continue; - - for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) - { - LLViewerInventoryItem *item = dynamic_cast( - gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, index)); - if (!item) - continue; - const LLUUID &item_id = item->getUUID(); - const LLWearable *wearable = gAgentWearables.getWearableFromItemID(item_id); - if (!wearable) - continue; - - // Find and remove this item from the COF. - LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); - } + // Fetch worn clothes (i.e. the ones in COF). + LLInventoryModel::item_array_t clothing_items; + LLInventoryModel::cat_array_t dummy; + LLIsType is_clothing(LLAssetType::AT_CLOTHING); + gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), + dummy, + clothing_items, + LLInventoryModel::EXCLUDE_TRASH, + is_clothing, + false); + + // Take them off by removing from COF. + for (LLInventoryModel::item_array_t::const_iterator it = clothing_items.begin(); it != clothing_items.end(); ++it) + { + LLAppearanceMgr::instance().removeItemFromAvatar((*it)->getUUID()); } - gInventory.notifyObservers(); - - // Remove wearables from gAgentWearables - LLAgentWearables::userRemoveAllClothes(); } // static -- cgit v1.2.3 From 136d202255d76e33cfa09f1c5eb7c7dfcb218630 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 16 Aug 2011 19:20:33 +0300 Subject: STORM-793 FIXED Disallowed parsing HTTP URLs in llGiveInventory notifications (one more case). The fix may look weird because we seem to wrap a SLURL with ... tags. But actually there is no SLURL, there's just an object name. Investigating that goes beyond the bug scope. --- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 310616d57e..c9ccd44b83 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5903,7 +5903,7 @@ No valid parcel could be found. name="ObjectGiveItem" type="offer"> An object named <nolink>[OBJECTFROMNAME]</nolink> owned by [NAME_SLURL] has given you this [OBJECTTYPE]: -[ITEM_SLURL] +<nolink>[ITEM_SLURL]</nolink>
@@ -51,7 +51,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/indra/newview/skins/default/xui/zh/menu_inventory_add.xml b/indra/newview/skins/default/xui/zh/menu_inventory_add.xml index 9199608200..a0fc060e27 100644 --- a/indra/newview/skins/default/xui/zh/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/zh/menu_inventory_add.xml @@ -21,9 +21,9 @@ - + - + diff --git a/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml index f51b27d9ce..74b90ada5e 100644 --- a/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/zh/menu_inventory_gear_default.xml @@ -11,7 +11,7 @@ - - + + diff --git a/indra/newview/skins/default/xui/zh/menu_outfit_gear.xml b/indra/newview/skins/default/xui/zh/menu_outfit_gear.xml index cf47020bd9..90704fee65 100644 --- a/indra/newview/skins/default/xui/zh/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/zh/menu_outfit_gear.xml @@ -13,8 +13,8 @@ - - + + diff --git a/indra/newview/skins/default/xui/zh/menu_participant_list.xml b/indra/newview/skins/default/xui/zh/menu_participant_list.xml index 3737e3d041..81ae6e4e85 100644 --- a/indra/newview/skins/default/xui/zh/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/zh/menu_participant_list.xml @@ -8,7 +8,7 @@ - + diff --git a/indra/newview/skins/default/xui/zh/menu_people_friends_view_sort.xml b/indra/newview/skins/default/xui/zh/menu_people_friends_view_sort.xml index 2b0c461312..59854faeec 100644 --- a/indra/newview/skins/default/xui/zh/menu_people_friends_view_sort.xml +++ b/indra/newview/skins/default/xui/zh/menu_people_friends_view_sort.xml @@ -2,7 +2,7 @@ - - - + + + diff --git a/indra/newview/skins/default/xui/zh/menu_people_groups_view_sort.xml b/indra/newview/skins/default/xui/zh/menu_people_groups_view_sort.xml index cf36507d74..1be5c69b94 100644 --- a/indra/newview/skins/default/xui/zh/menu_people_groups_view_sort.xml +++ b/indra/newview/skins/default/xui/zh/menu_people_groups_view_sort.xml @@ -1,5 +1,5 @@ - - + + diff --git a/indra/newview/skins/default/xui/zh/menu_people_nearby.xml b/indra/newview/skins/default/xui/zh/menu_people_nearby.xml index 49fa775424..9faa35001c 100644 --- a/indra/newview/skins/default/xui/zh/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/zh/menu_people_nearby.xml @@ -9,5 +9,5 @@ - + diff --git a/indra/newview/skins/default/xui/zh/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/zh/menu_people_nearby_multiselect.xml index c7aff48df4..1380e0b307 100644 --- a/indra/newview/skins/default/xui/zh/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/zh/menu_people_nearby_multiselect.xml @@ -6,5 +6,5 @@ - + diff --git a/indra/newview/skins/default/xui/zh/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/zh/menu_people_nearby_view_sort.xml index 5cf54b117b..a7f5c74b82 100644 --- a/indra/newview/skins/default/xui/zh/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/zh/menu_people_nearby_view_sort.xml @@ -1,8 +1,8 @@ - + - - + + diff --git a/indra/newview/skins/default/xui/zh/menu_place_add_button.xml b/indra/newview/skins/default/xui/zh/menu_place_add_button.xml index d0b9438cfc..95f8917234 100644 --- a/indra/newview/skins/default/xui/zh/menu_place_add_button.xml +++ b/indra/newview/skins/default/xui/zh/menu_place_add_button.xml @@ -1,5 +1,5 @@ - + diff --git a/indra/newview/skins/default/xui/zh/menu_url_group.xml b/indra/newview/skins/default/xui/zh/menu_url_group.xml index 2cbdd602cb..de97bb731f 100644 --- a/indra/newview/skins/default/xui/zh/menu_url_group.xml +++ b/indra/newview/skins/default/xui/zh/menu_url_group.xml @@ -1,6 +1,6 @@ - - + + diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index 6d70ac4c1f..ce588c7e6b 100644 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -26,7 +26,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -179,21 +179,21 @@ - - + + - + - + - - + + @@ -218,10 +218,10 @@ - + - + @@ -232,17 +232,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -278,8 +278,8 @@ - - + + @@ -310,7 +310,7 @@ - + @@ -325,10 +325,10 @@ - + - - + + @@ -336,7 +336,7 @@ - + @@ -380,14 +380,14 @@ - + - + @@ -410,9 +410,9 @@ - - - + + + diff --git a/indra/newview/skins/default/xui/zh/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/zh/menu_wearable_list_item.xml index c5c1f661fb..2eea314dd8 100644 --- a/indra/newview/skins/default/xui/zh/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/zh/menu_wearable_list_item.xml @@ -2,7 +2,7 @@ - + diff --git a/indra/newview/skins/default/xui/zh/mime_types.xml b/indra/newview/skins/default/xui/zh/mime_types.xml index 3498942f9b..89fe92fabc 100644 --- a/indra/newview/skins/default/xui/zh/mime_types.xml +++ b/indra/newview/skins/default/xui/zh/mime_types.xml @@ -5,7 +5,7 @@ 網頁內容 - This location has Web content + 這位置有網頁內容 顯示網頁內容 @@ -35,7 +35,7 @@ There is audio at this location @@ -61,12 +61,12 @@ @@ -76,7 +76,7 @@ @@ -86,7 +86,7 @@ @@ -106,7 +106,7 @@ @@ -121,22 +121,22 @@ @@ -186,32 +186,32 @@ diff --git a/indra/newview/skins/default/xui/zh/mime_types_linux.xml b/indra/newview/skins/default/xui/zh/mime_types_linux.xml index 3498942f9b..08839abe6a 100644 --- a/indra/newview/skins/default/xui/zh/mime_types_linux.xml +++ b/indra/newview/skins/default/xui/zh/mime_types_linux.xml @@ -35,7 +35,7 @@ There is audio at this location @@ -61,7 +61,7 @@ @@ -76,7 +76,7 @@ @@ -86,7 +86,7 @@ @@ -121,22 +121,22 @@ @@ -186,32 +186,32 @@ diff --git a/indra/newview/skins/default/xui/zh/mime_types_mac.xml b/indra/newview/skins/default/xui/zh/mime_types_mac.xml index 3f38c528a6..7958f64219 100644 --- a/indra/newview/skins/default/xui/zh/mime_types_mac.xml +++ b/indra/newview/skins/default/xui/zh/mime_types_mac.xml @@ -27,21 +27,21 @@ 圖像 - There is an image at this location + 有一個影像在此位置 - View this location's image + 察看在此位置的影像 - There is audio at this location + 有一個音頻在此位置 - Play this location's audio + 播放在此位置的音頻 @@ -61,12 +61,12 @@ @@ -76,7 +76,7 @@ @@ -86,7 +86,7 @@ @@ -106,7 +106,7 @@ @@ -121,22 +121,22 @@ @@ -186,32 +186,32 @@ diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml index 65bb8ce517..f819ed35e6 100644 --- a/indra/newview/skins/default/xui/zh/notifications.xml +++ b/indra/newview/skins/default/xui/zh/notifications.xml @@ -1,10 +1,10 @@ - Don't show me this again + 不再顯示此提醒 - Always choose this option + 總是選取這個選項 關閉 @@ -44,7 +44,7 @@