summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmaterial.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-03-27 21:59:52 -0500
committerDave Parks <davep@lindenlab.com>2013-03-27 21:59:52 -0500
commit4f8827d2a8fc37f88d271be20f8fa03b14ec5732 (patch)
treefe67cdbdc5d638b41fc0845fd947e6c4eb264e73 /indra/llprimitive/llmaterial.cpp
parenta4510f5b1ce72a639889431d6f86e10b6fff96ad (diff)
parent6300f4f768de13823a754831797cb34022f87b60 (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-development-materials
Diffstat (limited to 'indra/llprimitive/llmaterial.cpp')
-rw-r--r--indra/llprimitive/llmaterial.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index f6fd8e557a..7d1ce4ab86 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -181,3 +181,36 @@ bool LLMaterial::operator != (const LLMaterial& rhs) const
{
return !(*this == rhs);
}
+
+
+U32 LLMaterial::getShaderMask()
+{ //NEVER incorporate this value into the message system -- this function will vary depending on viewer implementation
+ U32 ret = 0;
+
+ //two least significant bits are "diffuse alpha mode"
+ ret = getDiffuseAlphaMode();
+
+ llassert(ret < SHADER_COUNT);
+
+ //next bit is whether or not specular map is present
+ const U32 SPEC_BIT = 0x4;
+
+ if (getSpecularID().notNull())
+ {
+ ret |= SPEC_BIT;
+ }
+
+ llassert(ret < SHADER_COUNT);
+
+ //next bit is whether or not normal map is present
+ const U32 NORM_BIT = 0x8;
+ if (getNormalID().notNull())
+ {
+ ret |= NORM_BIT;
+ }
+
+ llassert(ret < SHADER_COUNT);
+
+ return ret;
+}
+