summaryrefslogtreecommitdiff
path: root/indra/llrender/llshadermgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llshadermgr.cpp')
-rw-r--r--indra/llrender/llshadermgr.cpp106
1 files changed, 90 insertions, 16 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 751b250d96..986c1f2774 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -206,21 +206,40 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
if (features->hasLighting)
{
-
if (features->hasWaterFog)
{
if (features->disableTextureIndex)
{
- if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl"))
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightWaterNonIndexedF.glsl"))
+ {
+ return FALSE;
+ }
}
}
else
{
- if (!shader->attachObject("lighting/lightWaterF.glsl"))
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightWaterAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightWaterF.glsl"))
+ {
+ return FALSE;
+ }
}
shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
}
@@ -230,16 +249,36 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
{
if (features->disableTextureIndex)
{
- if (!shader->attachObject("lighting/lightNonIndexedF.glsl"))
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightNonIndexedF.glsl"))
+ {
+ return FALSE;
+ }
}
}
else
{
- if (!shader->attachObject("lighting/lightF.glsl"))
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightF.glsl"))
+ {
+ return FALSE;
+ }
}
shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
}
@@ -272,14 +311,28 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
{
if (features->disableTextureIndex)
{
- if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
+ if (features->hasAlphaMask)
+ {
+ if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else if (!shader->attachObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
{
return FALSE;
}
}
else
{
- if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl"))
+ if (features->hasAlphaMask)
+ {
+ if (!shader->attachObject("lighting/lightFullbrightWaterAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else if (!shader->attachObject("lighting/lightFullbrightWaterF.glsl"))
{
return FALSE;
}
@@ -310,16 +363,37 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
{
if (features->disableTextureIndex)
{
- if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl"))
+
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightFullbrightNonIndexedF.glsl"))
+ {
+ return FALSE;
+ }
}
}
else
{
- if (!shader->attachObject("lighting/lightFullbrightF.glsl"))
+ if (features->hasAlphaMask)
{
- return FALSE;
+ if (!shader->attachObject("lighting/lightFullbrightAlphaMaskF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!shader->attachObject("lighting/lightFullbrightF.glsl"))
+ {
+ return FALSE;
+ }
}
shader->mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits-1;
}
@@ -406,7 +480,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns)
LL_DEBUGS("ShaderLoading") << log << LL_ENDL;
}
}
-}
+ }
GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels)
{