summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmaterial.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-07-02 13:36:43 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-12-10 23:17:07 +0200
commit5691d302ef876a7e6fb6861441f14e5e7f0c7735 (patch)
treea87a93f40ca50645a194931c3bf641f01bcaf3f5 /indra/llprimitive/llmaterial.cpp
parentbb4d02446fa215520a11f219ebca453d2dea0388 (diff)
SL-12069 Issues with bakes-on-mesh and alpha modes
Diffstat (limited to 'indra/llprimitive/llmaterial.cpp')
-rw-r--r--indra/llprimitive/llmaterial.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index a219ac1450..a1bfc4edd9 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -28,6 +28,8 @@
#include "llmaterial.h"
+#include "../llrender/llglheaders.h"
+
/**
* Materials cap parameters
*/
@@ -105,6 +107,8 @@ LLMaterial::LLMaterial()
, mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT)
, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)
, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)
+ , mDiffuseFormatPrimary(GL_RGBA)
+ , mDiffuseBaked(false)
, mAlphaMaskCutoff(0)
{
}
@@ -311,6 +315,20 @@ void LLMaterial::setEnvironmentIntensity(U8 intensity)
mEnvironmentIntensity = intensity;
}
+U8 LLMaterial::getDiffuseAlphaModeRender() const
+{
+ if (mDiffuseBaked
+ || mDiffuseFormatPrimary == GL_RGBA
+ || mDiffuseFormatPrimary == GL_ALPHA)
+ {
+ return mDiffuseAlphaMode;
+ }
+ else
+ {
+ return DIFFUSE_ALPHA_MODE_NONE;
+ }
+}
+
U8 LLMaterial::getDiffuseAlphaMode() const
{
return mDiffuseAlphaMode;
@@ -321,6 +339,26 @@ void LLMaterial::setDiffuseAlphaMode(U8 alpha_mode)
mDiffuseAlphaMode = alpha_mode;
}
+U32 LLMaterial::getDiffuseFormatPrimary() const
+{
+ return mDiffuseFormatPrimary;
+}
+
+void LLMaterial::setDiffuseFormatPrimary(U32 format_primary)
+{
+ mDiffuseFormatPrimary = format_primary;
+}
+
+bool LLMaterial::getIsDiffuseBaked() const
+{
+ return mDiffuseBaked;
+}
+
+void LLMaterial::setDiffuseBaked(bool baked)
+{
+ mDiffuseBaked = baked;
+}
+
U8 LLMaterial::getAlphaMaskCutoff() const
{
return mAlphaMaskCutoff;
@@ -437,7 +475,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)
}
else
{
- ret = getDiffuseAlphaMode();
+ ret = getDiffuseAlphaModeRender();
}
llassert(ret < SHADER_COUNT);