summaryrefslogtreecommitdiff
path: root/indra/newview/llfetchedgltfmaterial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfetchedgltfmaterial.cpp')
-rw-r--r--indra/newview/llfetchedgltfmaterial.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp
index 97b959e5cb..1dd1dbabbe 100644
--- a/indra/newview/llfetchedgltfmaterial.cpp
+++ b/indra/newview/llfetchedgltfmaterial.cpp
@@ -34,6 +34,9 @@
#include "llshadermgr.h"
#include "pipeline.h"
+//static
+LLFetchedGLTFMaterial LLFetchedGLTFMaterial::sDefault;
+
LLFetchedGLTFMaterial::LLFetchedGLTFMaterial()
: LLGLTFMaterial()
, mExpectedFlusTime(0.f)
@@ -76,7 +79,14 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex)
{
// dividing the alpha cutoff by transparency here allows the shader to compare against
// the alpha value of the texture without needing the transparency value
- min_alpha = mAlphaCutoff/mBaseColor.mV[3];
+ if (mBaseColor.mV[3] > 0.f)
+ {
+ min_alpha = mAlphaCutoff / mBaseColor.mV[3];
+ }
+ else
+ {
+ min_alpha = 1024.f;
+ }
}
shader->uniform1f(LLShaderMgr::MINIMUM_ALPHA, min_alpha);
}