From ece32418e7c1828a65c88e526a5afcb635c5453a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 31 May 2011 14:35:59 -0500 Subject: SH-1682 Dynamically adjust the number of texture channels to use for indexed texture rendering based on available hardware. --- indra/llrender/llgl.cpp | 3 +- indra/llrender/llglslshader.cpp | 40 ++++- indra/llrender/llglslshader.h | 1 + indra/llrender/llrender.cpp | 2 +- indra/llrender/llshadermgr.cpp | 129 +++++++++++++--- indra/llrender/llshadermgr.h | 2 +- indra/newview/app_settings/settings.xml | 4 +- .../shaders/class1/avatar/avatarF.glsl | 2 +- .../shaders/class1/avatar/avatarSkinV.glsl | 2 +- .../shaders/class1/avatar/avatarV.glsl | 2 +- .../shaders/class1/avatar/eyeballF.glsl | 2 +- .../shaders/class1/avatar/eyeballV.glsl | 2 +- .../shaders/class1/avatar/objectSkinV.glsl | 2 +- .../shaders/class1/avatar/pickAvatarF.glsl | 2 +- .../shaders/class1/avatar/pickAvatarV.glsl | 2 +- .../shaders/class1/deferred/alphaF.glsl | 2 +- .../shaders/class1/deferred/alphaNonIndexedF.glsl | 67 +++++++++ .../shaders/class1/deferred/alphaSkinnedV.glsl | 2 +- .../shaders/class1/deferred/alphaV.glsl | 2 +- .../shaders/class1/deferred/attachmentShadowF.glsl | 2 +- .../shaders/class1/deferred/attachmentShadowV.glsl | 2 +- .../shaders/class1/deferred/avatarAlphaV.glsl | 2 +- .../shaders/class1/deferred/avatarEyesV.glsl | 2 +- .../shaders/class1/deferred/avatarF.glsl | 2 +- .../shaders/class1/deferred/avatarShadowF.glsl | 2 +- .../shaders/class1/deferred/avatarShadowV.glsl | 2 +- .../shaders/class1/deferred/avatarV.glsl | 2 +- .../shaders/class1/deferred/blurLightF.glsl | 2 +- .../shaders/class1/deferred/blurLightMSF.glsl | 2 +- .../shaders/class1/deferred/blurLightV.glsl | 2 +- .../shaders/class1/deferred/bumpF.glsl | 2 +- .../shaders/class1/deferred/bumpSkinnedV.glsl | 2 +- .../shaders/class1/deferred/bumpV.glsl | 2 +- .../shaders/class1/deferred/cloudsF.glsl | 2 +- .../shaders/class1/deferred/cloudsV.glsl | 2 +- .../shaders/class1/deferred/diffuseF.glsl | 2 +- .../shaders/class1/deferred/diffuseIndexedF.glsl | 31 ---- .../shaders/class1/deferred/diffuseSkinnedV.glsl | 2 +- .../shaders/class1/deferred/diffuseV.glsl | 2 +- .../shaders/class1/deferred/fullbrightF.glsl | 2 +- .../shaders/class1/deferred/fullbrightV.glsl | 2 +- .../app_settings/shaders/class1/deferred/giF.glsl | 2 +- .../app_settings/shaders/class1/deferred/giV.glsl | 2 +- .../shaders/class1/deferred/impostorF.glsl | 2 +- .../shaders/class1/deferred/impostorV.glsl | 2 +- .../shaders/class1/deferred/luminanceF.glsl | 2 +- .../shaders/class1/deferred/luminanceV.glsl | 2 +- .../shaders/class1/deferred/multiPointLightF.glsl | 2 +- .../class1/deferred/multiPointLightMSF.glsl | 2 +- .../shaders/class1/deferred/multiPointLightV.glsl | 2 +- .../shaders/class1/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class1/deferred/multiSpotLightMSF.glsl | 2 +- .../shaders/class1/deferred/pointLightF.glsl | 2 +- .../shaders/class1/deferred/pointLightMSF.glsl | 2 +- .../shaders/class1/deferred/pointLightV.glsl | 2 +- .../shaders/class1/deferred/postDeferredF.glsl | 2 +- .../shaders/class1/deferred/postDeferredMSF.glsl | 2 +- .../class1/deferred/postDeferredNoDoFF.glsl | 2 +- .../class1/deferred/postDeferredNoDoFMSF.glsl | 2 +- .../shaders/class1/deferred/postDeferredV.glsl | 2 +- .../shaders/class1/deferred/postgiF.glsl | 2 +- .../shaders/class1/deferred/postgiV.glsl | 2 +- .../shaders/class1/deferred/shadowF.glsl | 2 +- .../shaders/class1/deferred/shadowV.glsl | 2 +- .../app_settings/shaders/class1/deferred/skyF.glsl | 2 +- .../app_settings/shaders/class1/deferred/skyV.glsl | 2 +- .../shaders/class1/deferred/softenLightF.glsl | 2 +- .../shaders/class1/deferred/softenLightMSF.glsl | 2 +- .../shaders/class1/deferred/softenLightV.glsl | 2 +- .../shaders/class1/deferred/spotLightF.glsl | 2 +- .../shaders/class1/deferred/spotLightMSF.glsl | 2 +- .../shaders/class1/deferred/starsF.glsl | 2 +- .../shaders/class1/deferred/starsV.glsl | 2 +- .../shaders/class1/deferred/sunLightF.glsl | 2 +- .../shaders/class1/deferred/sunLightMSF.glsl | 2 +- .../shaders/class1/deferred/sunLightSSAOF.glsl | 2 +- .../shaders/class1/deferred/sunLightSSAOMSF.glsl | 2 +- .../shaders/class1/deferred/sunLightV.glsl | 2 +- .../shaders/class1/deferred/terrainF.glsl | 2 +- .../shaders/class1/deferred/terrainV.glsl | 2 +- .../shaders/class1/deferred/treeF.glsl | 2 +- .../shaders/class1/deferred/treeV.glsl | 2 +- .../shaders/class1/deferred/waterF.glsl | 2 +- .../shaders/class1/deferred/waterV.glsl | 2 +- .../shaders/class1/effects/glowExtractF.glsl | 2 +- .../shaders/class1/effects/glowExtractMSF.glsl | 2 +- .../shaders/class1/effects/glowExtractV.glsl | 2 +- .../app_settings/shaders/class1/effects/glowF.glsl | 2 +- .../app_settings/shaders/class1/effects/glowV.glsl | 2 +- .../shaders/class1/environment/terrainF.glsl | 2 +- .../shaders/class1/environment/terrainV.glsl | 2 +- .../shaders/class1/environment/terrainWaterF.glsl | 2 +- .../shaders/class1/environment/underWaterF.glsl | 2 +- .../shaders/class1/environment/waterF.glsl | 2 +- .../shaders/class1/environment/waterFogF.glsl | 2 +- .../shaders/class1/environment/waterV.glsl | 2 +- .../shaders/class1/interface/highlightF.glsl | 2 +- .../shaders/class1/interface/highlightV.glsl | 2 +- .../shaders/class1/lighting/lightF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightF.glsl | 2 +- .../class1/lighting/lightFullbrightShinyF.glsl | 2 +- .../lighting/lightFullbrightShinyWaterF.glsl | 2 +- .../class1/lighting/lightFullbrightWaterF.glsl | 2 +- .../class1/lighting/lightFuncSpecularV.glsl | 2 +- .../shaders/class1/lighting/lightFuncV.glsl | 2 +- .../shaders/class1/lighting/lightShinyF.glsl | 2 +- .../shaders/class1/lighting/lightShinyWaterF.glsl | 2 +- .../shaders/class1/lighting/lightSpecularV.glsl | 2 +- .../shaders/class1/lighting/lightV.glsl | 2 +- .../shaders/class1/lighting/lightWaterF.glsl | 2 +- .../class1/lighting/sumLightsSpecularV.glsl | 2 +- .../shaders/class1/lighting/sumLightsV.glsl | 2 +- .../shaders/class1/objects/fullbrightF.glsl | 2 +- .../shaders/class1/objects/fullbrightShinyF.glsl | 2 +- .../class1/objects/fullbrightShinySkinnedV.glsl | 2 +- .../shaders/class1/objects/fullbrightShinyV.glsl | 2 +- .../class1/objects/fullbrightShinyWaterF.glsl | 2 +- .../shaders/class1/objects/fullbrightSkinnedV.glsl | 2 +- .../shaders/class1/objects/fullbrightV.glsl | 2 +- .../shaders/class1/objects/fullbrightWaterF.glsl | 2 +- .../shaders/class1/objects/shinyF.glsl | 2 +- .../class1/objects/shinySimpleSkinnedV.glsl | 2 +- .../shaders/class1/objects/shinyV.glsl | 2 +- .../shaders/class1/objects/shinyWaterF.glsl | 2 +- .../shaders/class1/objects/simpleF.glsl | 2 - .../shaders/class1/objects/simpleSkinnedV.glsl | 2 +- .../shaders/class1/objects/simpleV.glsl | 2 +- .../shaders/class1/objects/simpleWaterF.glsl | 2 +- .../shaders/class1/windlight/atmosphericsF.glsl | 2 +- .../class1/windlight/atmosphericsHelpersV.glsl | 2 +- .../shaders/class1/windlight/atmosphericsV.glsl | 2 +- .../class1/windlight/atmosphericsVarsF.glsl | 2 +- .../class1/windlight/atmosphericsVarsV.glsl | 2 +- .../shaders/class1/windlight/gammaF.glsl | 2 +- .../shaders/class1/windlight/transportF.glsl | 2 +- .../shaders/class2/avatar/eyeballV.glsl | 2 +- .../shaders/class2/deferred/alphaF.glsl | 4 +- .../shaders/class2/deferred/alphaNonIndexedF.glsl | 125 ++++++++++++++++ .../shaders/class2/deferred/alphaSkinnedV.glsl | 2 +- .../shaders/class2/deferred/alphaV.glsl | 2 +- .../shaders/class2/deferred/avatarAlphaV.glsl | 2 +- .../shaders/class2/deferred/edgeF.glsl | 2 +- .../shaders/class2/deferred/edgeMSF.glsl | 2 +- .../shaders/class2/deferred/edgeV.glsl | 2 +- .../shaders/class2/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class2/deferred/multiSpotLightMSF.glsl | 2 +- .../shaders/class2/deferred/softenLightF.glsl | 2 +- .../shaders/class2/deferred/softenLightMSF.glsl | 2 +- .../shaders/class2/deferred/softenLightV.glsl | 2 +- .../shaders/class2/deferred/spotLightF.glsl | 2 +- .../shaders/class2/deferred/spotLightMSF.glsl | 2 +- .../shaders/class2/deferred/sunLightF.glsl | 2 +- .../shaders/class2/deferred/sunLightMSF.glsl | 2 +- .../shaders/class2/deferred/sunLightSSAOF.glsl | 2 +- .../shaders/class2/deferred/sunLightSSAOMSF.glsl | 2 +- .../shaders/class2/deferred/sunLightV.glsl | 2 +- .../app_settings/shaders/class2/effects/blurF.glsl | 2 +- .../app_settings/shaders/class2/effects/blurV.glsl | 2 +- .../shaders/class2/effects/colorFilterF.glsl | 2 +- .../shaders/class2/effects/drawQuadV.glsl | 2 +- .../shaders/class2/effects/extractF.glsl | 2 +- .../shaders/class2/effects/nightVisionF.glsl | 2 +- .../shaders/class2/effects/simpleF.glsl | 2 +- .../shaders/class2/environment/terrainF.glsl | 2 +- .../shaders/class2/environment/terrainV.glsl | 2 +- .../shaders/class2/environment/terrainWaterF.glsl | 2 +- .../shaders/class2/environment/underWaterF.glsl | 2 +- .../shaders/class2/environment/waterF.glsl | 2 +- .../shaders/class2/environment/waterFogF.glsl | 2 +- .../shaders/class2/lighting/lightF.glsl | 28 ---- .../shaders/class2/lighting/lightFullbrightF.glsl | 30 +--- .../lighting/lightFullbrightNonIndexedF.glsl | 2 +- .../class2/lighting/lightFullbrightShinyF.glsl | 29 +--- .../lighting/lightFullbrightShinyNonIndexedF.glsl | 2 +- .../lighting/lightFullbrightShinyWaterF.glsl | 27 +--- .../lightFullbrightShinyWaterNonIndexedF.glsl | 2 +- .../class2/lighting/lightFullbrightWaterF.glsl | 28 +--- .../lighting/lightFullbrightWaterNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightShinyF.glsl | 27 +--- .../class2/lighting/lightShinyNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightShinyWaterF.glsl | 27 +--- .../lighting/lightShinyWaterNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightSpecularV.glsl | 2 +- .../shaders/class2/lighting/lightV.glsl | 2 +- .../shaders/class2/lighting/lightWaterF.glsl | 28 ---- .../class2/lighting/lightWaterNonIndexedF.glsl | 2 +- .../class2/lighting/sumLightsSpecularV.glsl | 2 +- .../shaders/class2/lighting/sumLightsV.glsl | 2 +- .../shaders/class2/objects/fullbrightShinyV.glsl | 2 +- .../shaders/class2/objects/fullbrightV.glsl | 2 +- .../shaders/class2/objects/shinyV.glsl | 2 +- .../shaders/class2/objects/simpleV.glsl | 2 +- .../shaders/class2/windlight/atmosphericsF.glsl | 2 +- .../class2/windlight/atmosphericsHelpersV.glsl | 2 +- .../shaders/class2/windlight/atmosphericsV.glsl | 2 +- .../class2/windlight/atmosphericsVarsF.glsl | 2 +- .../class2/windlight/atmosphericsVarsV.glsl | 2 +- .../shaders/class2/windlight/cloudsF.glsl | 2 +- .../shaders/class2/windlight/cloudsV.glsl | 2 +- .../shaders/class2/windlight/gammaF.glsl | 2 +- .../shaders/class2/windlight/skyF.glsl | 2 +- .../shaders/class2/windlight/skyV.glsl | 2 +- .../shaders/class2/windlight/transportF.glsl | 2 - .../shaders/class3/avatar/avatarV.glsl | 2 +- .../shaders/class3/deferred/giDownsampleF.glsl | 2 +- .../shaders/class3/deferred/giDownsampleV.glsl | 2 +- .../app_settings/shaders/class3/deferred/giF.glsl | 2 +- .../shaders/class3/deferred/giFinalF.glsl | 2 +- .../shaders/class3/deferred/giFinalV.glsl | 2 +- .../app_settings/shaders/class3/deferred/giV.glsl | 2 +- .../shaders/class3/deferred/luminanceF.glsl | 2 +- .../shaders/class3/deferred/luminanceV.glsl | 2 +- .../shaders/class3/deferred/postDeferredF.glsl | 2 +- .../shaders/class3/deferred/postDeferredV.glsl | 2 +- .../shaders/class3/deferred/postgiF.glsl | 2 +- .../shaders/class3/deferred/postgiV.glsl | 2 +- .../shaders/class3/deferred/softenLightF.glsl | 2 +- .../shaders/class3/deferred/softenLightV.glsl | 2 +- .../shaders/class3/deferred/treeF.glsl | 2 +- .../class3/lighting/sumLightsSpecularV.glsl | 2 +- .../shaders/class3/lighting/sumLightsV.glsl | 2 +- indra/newview/lldrawpool.cpp | 5 +- indra/newview/lldrawpoolsimple.cpp | 3 +- indra/newview/llviewershadermgr.cpp | 166 +++++++-------------- indra/newview/llvovolume.cpp | 17 ++- 226 files changed, 620 insertions(+), 609 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 96b1838158..a8d7df3bc8 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -551,7 +551,7 @@ bool LLGLManager::initGL() { GLint num_tex_image_units; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &num_tex_image_units); - mNumTextureImageUnits = num_tex_image_units; + mNumTextureImageUnits = llmin(num_tex_image_units, 32); } if (mHasTextureMultisample) @@ -1516,6 +1516,7 @@ void LLGLState::checkTextureChannels(const std::string& msg) } } + stop_glerror(); gGL.getTexUnit(0)->activate(); glClientActiveTextureARB(GL_TEXTURE0_ARB); stop_glerror(); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 71d24bcf13..2dab757828 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -56,7 +56,7 @@ 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), disableTextureIndex(false) +hasGamma(false), hasLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false) { } @@ -107,16 +107,11 @@ BOOL LLGLSLShader::createShader(vector * attributes, // Create program mProgramObject = glCreateProgramObjectARB(); - // Attach existing objects - if (!LLShaderMgr::instance()->attachShaderFeatures(this)) - { - return FALSE; - } - + //compile new source vector< pair >::iterator fileIter = mShaderFiles.begin(); for ( ; fileIter != mShaderFiles.end(); fileIter++ ) { - GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second); + GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, mFeatures.mIndexedTextureChannels); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; if (shaderhandle > 0) { @@ -128,6 +123,12 @@ BOOL LLGLSLShader::createShader(vector * attributes, } } + // Attach existing objects + if (!LLShaderMgr::instance()->attachShaderFeatures(this)) + { + return FALSE; + } + // Map attributes and uniforms if (success) { @@ -149,6 +150,29 @@ BOOL LLGLSLShader::createShader(vector * attributes, return createShader(attributes,uniforms); } } + else if (mFeatures.mIndexedTextureChannels > 0) + { //override texture channels for indexed texture rendering + bind(); + S32 channel_count = mFeatures.mIndexedTextureChannels; + + for (S32 i = 0; i < channel_count; i++) + { + uniform1i(llformat("tex%d", i), i); + } + + S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten + for (U32 i = 0; i < mTexture.size(); i++) + { + if (mTexture[i] > -1 && mTexture[i] < channel_count) + { + llassert(cur_tex < gGLManager.mNumTextureImageUnits); + uniform1i(i, cur_tex); + mTexture[i] = cur_tex++; + } + } + unbind(); + } + return success; } diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 392688bba3..51be56b295 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -45,6 +45,7 @@ public: bool hasObjectSkinning; bool hasAtmospherics; bool hasGamma; + S32 mIndexedTextureChannels; bool disableTextureIndex; // char numLights; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0532510996..fdfcfe7fab 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -46,7 +46,7 @@ S32 gGLViewport[4]; U32 LLRender::sUICalls = 0; U32 LLRender::sUIVerts = 0; -static const U32 LL_NUM_TEXTURE_LAYERS = 16; +static const U32 LL_NUM_TEXTURE_LAYERS = 32; static const U32 LL_NUM_LIGHT_UNITS = 8; static GLenum sGLTextureType[] = diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 6fb1e6e437..e51ef8cfe7 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -216,9 +216,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightWaterF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightWaterF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } @@ -231,9 +235,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } } @@ -251,9 +259,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightFullbrightShinyWaterF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightShinyWaterF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } else if (features->hasWaterFog) @@ -265,9 +277,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } @@ -280,9 +296,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightFullbrightShinyF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightShinyF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } @@ -295,9 +315,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightFullbrightF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightFullbrightF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } } @@ -315,9 +339,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightShinyWaterF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightShinyWaterF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } @@ -330,9 +358,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) return FALSE; } } - else if (!shader->attachObject("lighting/lightShinyF.glsl")) + else { - return FALSE; + if (!shader->attachObject("lighting/lightShinyF.glsl")) + { + return FALSE; + } + shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1; } } } @@ -376,7 +408,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) } } -GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type) +GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels) { GLenum error = GL_NO_ERROR; if (gDebugGL) @@ -430,6 +462,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade GLcharARB* text[1024]; GLuint count = 0; + //set version to 1.20 + text[count++] = strdup("#version 120\n"); + //copy preprocessor definitions into buffer for (std::map::iterator iter = mDefinitions.begin(); iter != mDefinitions.end(); ++iter) { @@ -437,6 +472,64 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = (GLcharARB *) strdup(define.c_str()); } + if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB) + { + //use specified number of texture channels for indexed texture rendering + + /* prepend shader code that looks like this: + + uniform sampler2D tex0; + uniform sampler2D tex1; + uniform sampler2D tex2; + . + . + . + uniform sampler2D texN; + + varying float vary_texture_index; + + vec4 diffuseLookup(vec2 texcoord) + { + switch (int(vary_texture_index+0.25)) + { + case 0: return texture2D(tex0, texcoord); + case 1: return texture2D(tex1, texcoord); + case 2: return texture2D(tex2, texcoord); + . + . + . + case N: return texture2D(texN, texcoord); + } + + return vec4(0,0,0,0); + } + */ + + //uniform declartion + for (S32 i = 0; i < texture_index_channels; ++i) + { + std::string decl = llformat("uniform sampler2D tex%d;\n", i); + text[count++] = strdup(decl.c_str()); + } + + text[count++] = strdup("varying float vary_texture_index;\n"); + text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); + text[count++] = strdup("{\n"); + text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n"); + text[count++] = strdup("\t{\n"); + + //switch body + for (S32 i = 0; i < texture_index_channels; ++i) + { + std::string case_str = llformat("\t\tcase %d: return texture2D(tex%d, texcoord);\n", i, i); + text[count++] = strdup(case_str.c_str()); + } + + text[count++] = strdup("\t}\n"); + text[count++] = strdup("\treturn vec4(0,0,0,0);\n"); + text[count++] = strdup("}\n"); + } + //copy file into memory while( fgets((char *)buff, 1024, file) != NULL && count < LL_ARRAY_SIZE(buff) ) { @@ -519,7 +612,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (shader_level > 1) { shader_level--; - return loadShaderFile(filename,shader_level,type); + return loadShaderFile(filename,shader_level,type,texture_index_channels); } LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL; } diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 9ee11b98c8..2f30103811 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -43,7 +43,7 @@ public: void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE); BOOL linkProgramObject(GLhandleARB obj, BOOL suppress_errors = FALSE); BOOL validateProgramObject(GLhandleARB obj); - GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type); + GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels = -1); // Implemented in the application to actually point to the shader directory. virtual std::string getShaderDirPrefix(void) = 0; // Pure Virtual diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2c6d75e3c9..bed7e4705e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7113,7 +7113,7 @@ Type S32 Value - 1 + 4 OctreeAlphaDistanceFactor @@ -7154,7 +7154,7 @@ Vector3 Value - 0.05 + 0.25 0.0 0.0 diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarF.glsl index 3f6b8b3323..b0fa0ddd3e 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void default_lighting(); diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index 1ad87badfe..d9f29ced4f 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + attribute vec4 weight; //1 diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl index a15846f192..2796222c68 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballF.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballF.glsl index 05fe100372..d86ef19a04 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/eyeballF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void default_lighting(); diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl index 4b8a7604a1..2eb814bd91 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index ef823c28b1..7613e50dca 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + attribute vec4 object_weight; diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl index 27ac59a840..2638351e96 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl index f1aa549a47..86b189b282 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index f6b7f42c22..4a0815a163 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl new file mode 100644 index 0000000000..b0d029dbf4 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -0,0 +1,67 @@ +/** + * @file alphaF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2DRect depthMap; +uniform sampler2D diffuseMap; + + +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform vec2 screen_res; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +varying vec3 vary_ambient; +varying vec3 vary_directional; +varying vec3 vary_fragcoord; +varying vec3 vary_position; +varying vec3 vary_pointlight_col; + +uniform mat4 inv_proj; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos /= pos.w; + pos.w = 1.0; + return pos; +} + +void main() +{ + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; + + vec4 pos = vec4(vary_position, 1.0); + + vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy); + + vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a); + vec4 color = diff * col; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + color.rgb += diff.rgb * vary_pointlight_col.rgb; + + gl_FragColor = color; + //gl_FragColor = vec4(1,0,1,1); + //gl_FragColor = vec4(1,0,1,1)*shadow; + +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl index 65d9209983..ac3f7189c2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 5890c30d8f..44cb78e914 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl index 164322c3a7..870d593311 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl index 5ae41cb730..c7a4f86727 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index a012cb5030..68e4055cf2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl index 536bacd23c..7bc78fe407 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_normal; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index 9748727147..3268618093 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 3d0884bbe8..78986ab12e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl index 3460f40657..f177fcd8f1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl index 69c93799b5..7eac11287a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index 98d034c2b5..8c75c8045a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl index edec83ea07..6ca51377c1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl index c2d05c601a..862f809de5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 37bfaac32c..75b4dc624a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; uniform sampler2D bumpMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl index d884f2e4a5..dc69519a85 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + varying vec3 vary_mat0; varying vec3 vary_mat1; diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl index 9b109b2db6..5b6726488b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_mat0; varying vec3 vary_mat1; diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl index 9e551fa976..ef300d5631 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index 267ef36d4d..3eac63076c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index f71d9f0b49..43af480c50 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index 1bbaeb44ff..e7b5dcce7f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -5,43 +5,12 @@ * $/LicenseInfo$ */ -#version 120 - -varying float vary_texture_index; varying vec3 vary_normal; -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; -uniform sampler2D tex7; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - case 7: return texture2D(tex7, texcoord); - } - - return vec4(0,0,0,0); -} - void main() { vec3 col = gl_Color.rgb * diffuseLookup(gl_TexCoord[0].xy).rgb; - //col = vec3(vary_texture_index*0.25, 0, 0); - gl_FragData[0] = vec4(col, 0.0); gl_FragData[1] = gl_Color.aaaa; // spec //gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl index 9a45c03237..2c4caea109 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + varying vec3 vary_normal; diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index b8de629fc8..b56d1493c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_normal; varying float vary_texture_index; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 30231039b0..029f282d7c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index 6890360c56..2eed044b7c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index 75b555e8ae..41c149e774 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl index 8dc1410ea5..e86f2896da 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index e3c15a2ab2..fa811f0d55 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; uniform sampler2D normalMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl index 37148b3f1a..723777bd3a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl index 78df54d5dc..25e93ae266 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl index 0c820bfc6c..4baf1fc65a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index e10fb105e8..3c5c780d94 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl index 66c7a5cb4a..6c43679acf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl index 2e3e84dd15..434fb6f534 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec4 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index a9f03f7615..0d25d7792d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + //class 1 -- no shadows diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl index b450ff1ca2..c80a54346e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + //class 1 -- no shadows diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 0d771109fb..5efa3200d4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ - #version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl index 7521c3310c..feaf38115d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ - #version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl index 2377947e7f..c510d8ad77 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec4 vary_light; varying vec4 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index d389add03b..f6b0402bb9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl index 711c6dc96d..62ae5f917a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index ab48d08bbb..bf829bfc56 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl index 359b26b7d4..bf35dfe11c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl index 12983baa94..876f65ee3a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 63b3c9f205..fa3f04bcc8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl index ae57227fe5..eebe930666 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index 6674c4a5aa..e0c5406483 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl index db3bddc6be..9271a5115c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec4 post_pos; diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index 91143943b6..820c82ffd7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 03bca8f27e..1ea00f723a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index c1147feff6..60082f40d6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl index fcba4f57e6..9dfacfb520 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl index 8f0bcca76b..745cc01992 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 29fac46bfe..9aaffc15bf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl index 6702bd5014..4bb9bad275 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + //class 1 -- no shadows diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index b1c25b7fd3..2cf7d194cc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl index 1f0376ce6b..c43125dad9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void main() diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 00093836a2..f20886565a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + //class 1, no shadow, no SSAO, should never be called diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl index 00093836a2..f20886565a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + //class 1, no shadow, no SSAO, should never be called diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index d1e8359742..665d8126a0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl index ce0ebc54f8..32d1b2149a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOMSF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl index 9beb513ad8..814deb3677 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec4 vary_light; varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index 0edae47918..d005f67bf6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D detail_0; uniform sampler2D detail_1; diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl index a6163063be..3038fd2966 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_normal; diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index c54d9a1e3e..de7e038402 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl index 29689ecbaf..a9bef4292d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_normal; diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index e76f598d09..2710422d32 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl index 649e392630..5397290b11 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index f2023fa5ea..32f5f5f236 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl index c03a0c61bd..9267a8585d 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl index 0ca0608b45..76736fed53 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void main() { diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index 65fc2e9f99..d3225546b3 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; uniform float glowStrength; diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl index 0bd44cec90..9bb41626ae 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec2 glowDelta; diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index ac00f15b35..cdc2ca3da2 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D detail0; uniform sampler2D detail1; diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl index 1e19ee7699..8af981915b 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index 34f78565a5..d94d986581 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // this class1 shader is just a copy of terrainF diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 0dfac84a6e..06854fcc0a 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; uniform sampler2D bumpMap; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 4e9c09b1ea..0f24e3c35a 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 scaleSoftClip(vec3 inColor); vec3 atmosTransport(vec3 inColor); diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl index a34cf23790..630459b324 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 applyWaterFog(vec4 color) { diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl index 161c794c68..831d6a761c 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 6f821f893d..f6c6d945de 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index d1c98bf70c..f114f766bf 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void main() { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 9c59e8c3ad..1796730c92 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index 1fee99c446..bfe0be9fdf 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index fb5da21c72..6f1fe91007 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl index 1bdaccf9b8..19072cd052 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl @@ -6,7 +6,7 @@ */ -#version 120 + uniform sampler2D diffuseMap; uniform samplerCube environmentMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl index 2e94d3bbf1..0ae6dc89e2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl @@ -6,7 +6,7 @@ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl index 714f9a2551..5d4bf2c33e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l) { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index 65b45f8081..574252af12 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l) diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index 7f65ea76f7..29f575b7e5 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 8f13e6dc04..65da5a6825 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl index 56f31f6a79..d491f1102e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index 64d549ff52..ef38ee9699 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index c5d084c132..286c92326b 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl index 732d246471..772a420e33 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da); vec3 atmosAmbient(vec3 light); diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl index 73e1a1ec26..da60a3ddf5 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl index afc3dc89bf..c0b72115dd 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void fullbright_lighting(); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyF.glsl index 3dc4294f67..391c06edc8 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void fullbright_shiny_lighting(); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl index f0baeeeee5..f44a5ce32e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl index 02367b9439..31e0f0a429 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyWaterF.glsl index 5daf66fb31..8ffb252f57 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyWaterF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + void fullbright_shiny_lighting_water(); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl index 02ff3cc2a9..e5dafa8c78 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl index 38e07dbd80..3382384c99 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightWaterF.glsl index afaac4f69c..220f26614f 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void fullbright_lighting_water(); diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl index 2cf7a69baa..d079de5377 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void shiny_lighting(); diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl index 4146646058..cd655f3bb5 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl index 6ea83b721d..68a086dbc1 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl index e3babe2210..4649d1c47c 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void shiny_lighting_water(); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleF.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleF.glsl index d449d37c0c..b4e4dcfbbf 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleF.glsl @@ -5,8 +5,6 @@ * $/LicenseInfo$ */ -#version 120 - void default_lighting(); void main() diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl index be38a14d52..900448035c 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 0d8e14e2e3..b493f76fcc 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleWaterF.glsl index 68bd81e029..4ec5ee43b4 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void default_lighting_water(); diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl index f337bde329..3d05850ab3 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 atmosLighting(vec3 light) { diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl index 4b402a7028..f1a0af21af 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 atmosAmbient(vec3 light) { diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl index 20948b1e46..73bbd57315 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void setPositionEye(vec3 v); diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl index 8a2c2a7186..e0eb7b3767 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl index a1dd4ed5fe..a251213ff5 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsVarsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl index 7aed1fd3b5..4958cb2f72 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec4 gamma; diff --git a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl index 6780dc4d3e..75929bc609 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 atmosTransport(vec3 light) { diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl index 172c2ca078..3e8b719f93 100644 --- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index bd4875f3ff..681e52de2a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable @@ -15,8 +15,6 @@ uniform sampler2DRectShadow shadowMap2; uniform sampler2DRectShadow shadowMap3; uniform sampler2DRect depthMap; -vec4 diffuseLookup(vec2 texcoord); - uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl new file mode 100644 index 0000000000..5350359f75 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -0,0 +1,125 @@ +/** + * @file alphaF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DRect depthMap; +uniform sampler2D diffuseMap; + +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform vec2 screen_res; +uniform vec2 shadow_res; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +varying vec3 vary_ambient; +varying vec3 vary_directional; +varying vec3 vary_fragcoord; +varying vec3 vary_position; +varying vec3 vary_pointlight_col; + +uniform float shadow_bias; + +uniform mat4 inv_proj; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos.xyz /= pos.w; + pos.w = 1.0; + return pos; +} + +float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs); + + return shadow/5.0; +} + + +void main() +{ + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; + + float shadow = 1.0; + vec4 pos = vec4(vary_position, 1.0); + + vec4 spos = pos; + + if (spos.z > -shadow_clip.w) + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap3, lpos, 1.5); + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap2, lpos, 1.5); + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap1, lpos, 1.5); + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap0, lpos, 1.5); + } + } + + vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy); + + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); + vec4 color = diff * col; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + color.rgb += diff.rgb * vary_pointlight_col.rgb; + + //gl_FragColor = gl_Color; + gl_FragColor = color; + //gl_FragColor.r = 0.0; + //gl_FragColor = vec4(1,shadow,1,1); + +} + diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index dfb36980b0..948a52da5b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index c6c0b0f32a..f616ecc872 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 0ae09df0c6..01e40afc4f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index 30e1702e9f..729e4b5543 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl index 38100d1523..b22bc5b288 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl index b3413c301f..393084a3db 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index de987b1233..f54186ffca 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index d0f9101774..fee32be3e3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index dfa1964142..66a1a8515f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index cb09fe9895..0bae10ca7d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index 8f0bcca76b..745cc01992 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 50b9ef276e..cd3828fbd4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 8d6ffd79c5..ec9b547a47 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index b724c134b9..315139b415 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl index dd6fa958c9..63d13c996d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 68e18162f6..6dbcc479e1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl index d28741f945..a2a76eed9f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 9beb513ad8..814deb3677 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec4 vary_light; varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl index a4ad0bfa15..dff4d4a68f 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect RenderTexture; uniform float bloomStrength; diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl index d471a6c5e5..de469542f9 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec2 texelSize; uniform vec2 blurDirection; diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl index 66880b958e..8871bb3fc7 100644 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect RenderTexture; uniform float brightness; diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl index c35c500d62..9c52b8dd5d 100644 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void main(void) { diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl index e77baa5bee..713f8021de 100644 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect RenderTexture; uniform float extractLow; diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl index 8e0eec6f5e..fd94b2e95f 100644 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect RenderTexture; uniform sampler2D NoiseTexture; diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl index 98a50e22fc..a1a9c9716c 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect RenderTexture; diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl index bbb8951f3a..9527dc469b 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D detail_0; uniform sampler2D detail_1; diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl index 84906c16bf..2658bee88d 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl index 7590c542ef..974e227b77 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D detail_0; uniform sampler2D detail_1; diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl index 900f1a6cb8..702e0881ac 100644 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; uniform sampler2D bumpMap; diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl index f4f6b6e90f..c4e4bc08c5 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 scaleSoftClip(vec3 inColor); vec3 atmosTransport(vec3 inColor); diff --git a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl index 9f3328cbf0..b66b72b401 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec4 lightnorm; uniform vec4 waterPlane; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl index d5775f4506..4c31602736 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl @@ -5,35 +5,7 @@ * $/LicenseInfo$ */ -#version 120 -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; -uniform sampler2D tex7; - -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - case 7: return texture2D(tex7, texcoord); - } - - return vec4(0,0,0,0); -} vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl index e64b089dca..95bd052b5d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl @@ -5,39 +5,11 @@ * $/LicenseInfo$ */ -#version 120 + vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; -uniform sampler2D tex7; - -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - case 7: return texture2D(tex7, texcoord); - } - - return vec4(0,0,0,0); -} - void fullbright_lighting() { vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl index 811a919d52..b1e61e1a33 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index f4ac789a74..26f0ea84e0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -5,36 +5,9 @@ * $/LicenseInfo$ */ -#version 120 - -uniform samplerCube environmentMap; -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; - -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - } - - return vec4(0,0,0,0); -} +uniform samplerCube environmentMap; vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl index 51a7ddb89a..953298da0d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform samplerCube environmentMap; uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl index 277170e8af..a6e10a249d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl @@ -5,35 +5,10 @@ * $License$ */ -#version 120 -uniform samplerCube environmentMap; -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; - -varying float vary_texture_index; -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - } - - return vec4(0,0,0,0); -} +uniform samplerCube environmentMap; vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index a9a95940e6..b4bb665a2b 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#version 120 + uniform samplerCube environmentMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl index 37e33059a6..887d4130e7 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl @@ -5,35 +5,9 @@ * $/LicenseInfo$ */ -#version 120 -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; -uniform sampler2D tex7; -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - case 7: return texture2D(tex7, texcoord); - } - - return vec4(0,0,0,0); -} +vec4 diffuseLookup(vec2 texcoord); vec3 fullbrightAtmosTransport(vec3 light); vec4 applyWaterFog(vec4 color); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl index 3d46c8d874..1234682ae9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl index 787eeb7af6..149cf791f5 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl index 9f438f513f..300fcac092 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl @@ -5,35 +5,10 @@ * $/LicenseInfo$ */ -#version 120 -uniform samplerCube environmentMap; -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; - -varying float vary_texture_index; -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - } - - return vec4(0,0,0,0); -} +uniform samplerCube environmentMap; vec3 scaleSoftClip(vec3 light); vec3 atmosLighting(vec3 light); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl index 212eacd6ea..e877c0abb1 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform samplerCube environmentMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl index 5e11f6585c..07572fa915 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl @@ -5,35 +5,10 @@ * $/LicenseInfo$ */ -#version 120 -uniform samplerCube environmentMap; -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; - -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - } - return vec4(0,0,0,0); -} +uniform samplerCube environmentMap; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl index cb8a24da60..3904179427 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl index ad1dc4da77..3384f64d07 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // All lights, no specular highlights diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl index a0f6e019ef..10c770fcc2 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // All lights, no specular highlights diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl index 022544a917..61341a9f1f 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl @@ -5,35 +5,7 @@ * $/LicenseInfo$ */ -#version 120 -uniform sampler2D tex0; -uniform sampler2D tex1; -uniform sampler2D tex2; -uniform sampler2D tex3; -uniform sampler2D tex4; -uniform sampler2D tex5; -uniform sampler2D tex6; -uniform sampler2D tex7; - -varying float vary_texture_index; - -vec4 diffuseLookup(vec2 texcoord) -{ - switch (int(vary_texture_index+0.25)) - { - case 0: return texture2D(tex0, texcoord); - case 1: return texture2D(tex1, texcoord); - case 2: return texture2D(tex2, texcoord); - case 3: return texture2D(tex3, texcoord); - case 4: return texture2D(tex4, texcoord); - case 5: return texture2D(tex5, texcoord); - case 6: return texture2D(tex6, texcoord); - case 7: return texture2D(tex7, texcoord); - } - - return vec4(0,0,0,0); -} vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl index dc16f2d5cd..ba850b61d0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl index fde32ed035..8df2e6f222 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da); vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3 l, float r, float pw, vec3 lightCol); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index 8fe49e3be0..3d43a1813a 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l); float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl index e2145e1956..f49e74406f 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl index c4a3611a29..3076fa3260 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl index 436c193c5d..49992d3535 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl index 50d2beee57..5e02391767 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl index 77d15fba9a..21a0812c1b 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ////////////////////////////////////////////////////////// // The fragment shader for the terrain atmospherics diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl index 8c5b864cbe..ab4cf4806d 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // Output variables vec3 getSunlitColor(); diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index 8d365c15ca..b61b0bb396 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // varying param funcs void setSunlitColor(vec3 v); diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index cf9ef30632..3a6585bb33 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 398f1556a0..0f6e231ca6 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index 13207997b2..20f907a006 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 267ef36d4d..3eac63076c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl index a658edd21f..6570dcb608 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec4 gamma; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index 77ca4868a6..d14c638130 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 03bca8f27e..1ea00f723a 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index 7f1ad4d5b4..28381482c1 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -5,8 +5,6 @@ * $/LicenseInfo$ */ -#version 120 - ////////////////////////////////////////////////////////// // The fragment shader for the terrain atmospherics ////////////////////////////////////////////////////////// diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl index a003e2a1f1..3d970d252c 100644 --- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl index fc370ef367..498fee7c66 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2DRect giLightMap; diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl index ae57227fe5..eebe930666 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl index 951e3e97ae..9896f8dafe 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl index b2f8b2c633..df4c6b3e0a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl index 19c4e07b8b..7e20d71529 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl index 8dc1410ea5..e86f2896da 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl index 5f3bf68b24..980def6443 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl index a24eda35dc..9afeac6ddf 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl index ab99a88971..6d4c20f68c 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl index 12983baa94..876f65ee3a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl index f037754708..fc65881680 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/postgiF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl index ae57227fe5..eebe930666 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + varying vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ce32f66000..d38d33cc21 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl index 8f0bcca76b..745cc01992 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl index c54d9a1e3e..de7e038402 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/treeF.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl index 04533fdce1..92347a5b4a 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLightSpecular(inout vec4 specular, vec3 view, vec3 n, vec3 l, vec3 lightCol, float da); vec3 calcPointLightSpecular(inout vec4 specular, vec3 view, vec3 v, vec3 n, vec3 l, float r, float pw, vec3 lightCol); diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl index 73bc18b866..24bbc0a1a1 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl @@ -5,7 +5,7 @@ * $/LicenseInfo$ */ -#version 120 + float calcDirectionalLight(vec3 n, vec3 l); float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index b8b12018d2..d92d9e92a1 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -191,7 +191,7 @@ void LLDrawPool::renderPostDeferred(S32 pass) //virtual void LLDrawPool::endRenderPass( S32 pass ) { - for (U32 i = 1; i < 8; i++) + for (U32 i = 1; i < gGLManager.mNumTextureImageUnits; i++) { //dummy cleanup of any currently bound textures if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE) { @@ -199,6 +199,8 @@ void LLDrawPool::endRenderPass( S32 pass ) gGL.getTexUnit(i)->disable(); } } + + gGL.getTexUnit(0)->activate(); } //virtual @@ -491,6 +493,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba if (params.mTextureMatrix) { tex_setup = true; + gGL.getTexUnit(0)->activate(); glMatrixMode(GL_TEXTURE); glLoadMatrixf((GLfloat*) params.mTextureMatrix->mMatrix); gPipeline.mTextureMatrixOps++; diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 9b73b2f9b6..6963fea26b 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -171,8 +171,9 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass) void LLDrawPoolSimple::endRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_SIMPLE); + stop_glerror(); LLRenderPass::endRenderPass(pass); - + stop_glerror(); if (mVertexShaderLevel > 0) { simple_shader->unbind(); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e60b3f4543..fb92fabaeb 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -720,32 +720,35 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.clear(); shaders.reserve(13); - shaders.push_back( make_pair( "windlight/atmosphericsVarsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); - shaders.push_back( make_pair( "windlight/gammaF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT]) ); - shaders.push_back( make_pair( "windlight/atmosphericsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); - shaders.push_back( make_pair( "windlight/transportF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); - shaders.push_back( make_pair( "environment/waterFogF.glsl", mVertexShaderLevel[SHADER_WATER] ) ); - shaders.push_back( make_pair( "lighting/lightF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightShinyNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightShinyNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightShinyWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterNonIndexedF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); + S32 ch = gGLManager.mNumTextureImageUnits-1; + + std::vector index_channels; + index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsVarsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/gammaF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT]) ); + index_channels.push_back(-1); shaders.push_back( make_pair( "windlight/atmosphericsF.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); + 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/lightFullbrightNonIndexedF.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/lightFullbrightWaterNonIndexedF.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/lightFullbrightF.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/lightFullbrightWaterF.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] ) ); + index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, index_channels[i]) == 0) { return FALSE; } @@ -976,46 +979,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects() } -void setup_indexed_texture(LLGLSLShader& shader) -{ - shader.bind(); - shader.uniform1i("tex0", 0); - shader.uniform1i("tex1", 1); - shader.uniform1i("tex2", 2); - shader.uniform1i("tex3", 3); - shader.uniform1i("tex4", 4); - shader.uniform1i("tex5", 5); - shader.uniform1i("tex6", 6); - shader.uniform1i("tex7", 7); - - S32 cur_tex = 8; //adjust any texture channels that might have been overwritten - for (U32 i = 0; i < shader.mTexture.size(); i++) - { - if (shader.mTexture[i] > -1 && shader.mTexture[i] < 7) - { - shader.uniform1i(i, cur_tex); - shader.mTexture[i] = cur_tex++; - } - } - shader.unbind(); -} - -void setup_indexed_texture_with_cubemap(LLGLSLShader& shader) -{ - shader.bind(); - shader.uniform1i("tex0", 0); - shader.uniform1i("tex1", 1); - shader.uniform1i("tex2", 2); - shader.uniform1i("tex3", 3); - shader.uniform1i("tex4", 4); - shader.uniform1i("tex5", 5); - shader.uniform1i("tex6", 6); - shader.uniform1i("environmentMap", 7); - shader.mTexture[LLViewerShaderMgr::ENVIRONMENT_MAP] = 7; - shader.mTexture[LLViewerShaderMgr::DIFFUSE_MAP] = 0; - shader.unbind(); -} - BOOL LLViewerShaderMgr::loadShadersDeferred() { if (mVertexShaderLevel[SHADER_DEFERRED] == 0) @@ -1070,13 +1033,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseProgram.mShaderFiles.clear(); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredDiffuseProgram.createShader(NULL, NULL); - - if (success) - { //force tex0-7 to appropriate texture channels - setup_indexed_texture(gDeferredDiffuseProgram); - } } if (success) @@ -1121,9 +1080,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.hasGamma = true; gDeferredSkinnedAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true; + gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredSkinnedAlphaProgram.mShaderFiles.clear(); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); } @@ -1305,15 +1265,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mFeatures.hasGamma = true; gDeferredAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredAlphaProgram.mFeatures.hasLighting = true; + gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels + if (mVertexShaderLevel[SHADER_DEFERRED] < 1) + { + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits; + } + else + { //shave off some texture units for shadow maps + gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits - 6; + } + gDeferredAlphaProgram.mShaderFiles.clear(); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAlphaProgram.createShader(NULL, NULL); - if (success) - { - setup_indexed_texture(gDeferredAlphaProgram); - } } if (success) @@ -1323,6 +1289,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarEyesProgram.mFeatures.hasGamma = true; gDeferredAvatarEyesProgram.mFeatures.hasTransport = true; gDeferredAvatarEyesProgram.mFeatures.isFullbright = true; + gDeferredAvatarEyesProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarEyesProgram.mShaderFiles.clear(); gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -1337,16 +1304,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightProgram.mFeatures.hasGamma = true; gDeferredFullbrightProgram.mFeatures.hasTransport = true; gDeferredFullbrightProgram.mFeatures.isFullbright = true; + gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = 0; gDeferredFullbrightProgram.mShaderFiles.clear(); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredFullbrightProgram.createShader(NULL, NULL); - - if (success) - { - setup_indexed_texture(gDeferredFullbrightProgram); - } } if (success) @@ -1453,9 +1416,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.hasGamma = true; gDeferredAvatarAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true; + gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); } @@ -1777,16 +1741,12 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleProgram.mFeatures.hasGamma = true; gObjectSimpleProgram.mFeatures.hasAtmospherics = true; gObjectSimpleProgram.mFeatures.hasLighting = true; + gObjectSimpleProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleProgram.mShaderFiles.clear(); gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectSimpleProgram.createShader(NULL, NULL); - - if (success && batch_textures) - { - setup_indexed_texture(gObjectSimpleProgram); - } } if (success) @@ -1797,17 +1757,13 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; gObjectSimpleWaterProgram.mFeatures.hasLighting = true; + gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleWaterProgram.mShaderFiles.clear(); gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectSimpleWaterProgram.createShader(NULL, NULL); - - if (success && batch_textures) - { - setup_indexed_texture(gObjectSimpleWaterProgram); - } } if (success) @@ -1817,15 +1773,12 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightProgram.mFeatures.hasGamma = true; gObjectFullbrightProgram.mFeatures.hasTransport = true; gObjectFullbrightProgram.mFeatures.isFullbright = true; + gObjectFullbrightProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightProgram.mShaderFiles.clear(); gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectFullbrightProgram.createShader(NULL, NULL); - if (success && batch_textures) - { - setup_indexed_texture(gObjectFullbrightProgram); - } } if (success) @@ -1835,16 +1788,13 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterProgram.mFeatures.isFullbright = true; gObjectFullbrightWaterProgram.mFeatures.hasWaterFog = true; gObjectFullbrightWaterProgram.mFeatures.hasTransport = true; + gObjectFullbrightWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightWaterProgram.mShaderFiles.clear(); gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectFullbrightWaterProgram.createShader(NULL, NULL); - if (success && batch_textures) - { - setup_indexed_texture(gObjectFullbrightWaterProgram); - } } if (success) @@ -1855,15 +1805,12 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyProgram.mFeatures.hasGamma = true; gObjectShinyProgram.mFeatures.hasAtmospherics = true; gObjectShinyProgram.mFeatures.isShiny = true; + gObjectShinyProgram.mFeatures.mIndexedTextureChannels = 0; gObjectShinyProgram.mShaderFiles.clear(); gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectShinyProgram.createShader(NULL, &mShinyUniforms); - if (success && batch_textures) - { - setup_indexed_texture_with_cubemap(gObjectShinyProgram); - } } if (success) @@ -1874,16 +1821,13 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyWaterProgram.mFeatures.isShiny = true; gObjectShinyWaterProgram.mFeatures.hasWaterFog = true; gObjectShinyWaterProgram.mFeatures.hasAtmospherics = true; + gObjectShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectShinyWaterProgram.mShaderFiles.clear(); gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectShinyWaterProgram.createShader(NULL, &mShinyUniforms); - if (success && batch_textures) - { - setup_indexed_texture_with_cubemap(gObjectShinyWaterProgram); - } } if (success) @@ -1894,15 +1838,12 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyProgram.mFeatures.isShiny = true; gObjectFullbrightShinyProgram.mFeatures.hasGamma = true; gObjectFullbrightShinyProgram.mFeatures.hasTransport = true; + gObjectFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightShinyProgram.mShaderFiles.clear(); gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); - if (success && batch_textures) - { - setup_indexed_texture_with_cubemap(gObjectFullbrightShinyProgram); - } } if (success) @@ -1914,16 +1855,13 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.mFeatures.hasGamma = true; gObjectFullbrightShinyWaterProgram.mFeatures.hasTransport = true; gObjectFullbrightShinyWaterProgram.mFeatures.hasWaterFog = true; + gObjectFullbrightShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightShinyWaterProgram.mShaderFiles.clear(); gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectFullbrightShinyWaterProgram.createShader(NULL, &mShinyUniforms); - if (success && batch_textures) - { - setup_indexed_texture_with_cubemap(gObjectFullbrightShinyWaterProgram); - } } if (mVertexShaderLevel[SHADER_AVATAR] > 0) @@ -2103,6 +2041,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mFeatures.hasGamma = true; gAvatarProgram.mFeatures.hasAtmospherics = true; gAvatarProgram.mFeatures.hasLighting = true; + gAvatarProgram.mFeatures.disableTextureIndex = true; gAvatarProgram.mShaderFiles.clear(); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -2118,6 +2057,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarWaterProgram.mFeatures.hasWaterFog = true; gAvatarWaterProgram.mFeatures.hasAtmospherics = true; gAvatarWaterProgram.mFeatures.hasLighting = true; + gAvatarWaterProgram.mFeatures.disableTextureIndex = true; gAvatarWaterProgram.mShaderFiles.clear(); gAvatarWaterProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -2138,6 +2078,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() { gAvatarPickProgram.mName = "Avatar Pick Shader"; gAvatarPickProgram.mFeatures.hasSkinning = true; + gAvatarPickProgram.mFeatures.disableTextureIndex = true; gAvatarPickProgram.mShaderFiles.clear(); gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -2154,6 +2095,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarEyeballProgram.mFeatures.hasGamma = true; gAvatarEyeballProgram.mFeatures.hasAtmospherics = true; gAvatarEyeballProgram.mFeatures.hasLighting = true; + gAvatarEyeballProgram.mFeatures.disableTextureIndex = true; gAvatarEyeballProgram.mShaderFiles.clear(); gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER_ARB)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ed6edbb65b..125283d474 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4455,6 +4455,14 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: buffer_index = -1; } + S32 texture_index_channels = gGLManager.mNumTextureImageUnits-1; //always reserve one for shiny for now just for simplicity + + if (LLPipeline::sRenderDeferred && distance_sort) + { + texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels; + } + + while (face_iter != faces.end()) { //pull off next face @@ -4521,11 +4529,6 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: else { cur_tex++; - - if (cur_tex >= 7 && facep->getTextureEntry()->getShiny()) - { //entry 7 is reserved for the environment map for shiny faces - break; - } } if (!can_batch_texture(facep)) @@ -4534,8 +4537,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: break; } - if (cur_tex >= 8) - { //cut batches on every 8 textures + if (cur_tex >= texture_index_channels) + { //cut batches when index channels are depleted break; } -- cgit v1.2.3