diff options
| author | RunitaiLinden <davep@lindenlab.com> | 2024-03-25 15:40:43 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 15:40:43 -0500 | 
| commit | 0b159ef78175ab5ff1429aada0abc0c9dd232ea4 (patch) | |
| tree | 487f1b9e58736da2a4749f71c83b1334a3c1bff2 | |
| parent | aa687c002b8258a75bfd657a220a4349da073038 (diff) | |
https://github.com/secondlife/jira-archive-internal/issues/71091 Fix for divide by zero when alpha masking a PBR material with 0 alpha. (#1044)
| -rw-r--r-- | indra/newview/llfetchedgltfmaterial.cpp | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp index 97b959e5cb..1ca7ffaec1 100644 --- a/indra/newview/llfetchedgltfmaterial.cpp +++ b/indra/newview/llfetchedgltfmaterial.cpp @@ -76,7 +76,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);      }  | 
