From 0b159ef78175ab5ff1429aada0abc0c9dd232ea4 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Mon, 25 Mar 2024 15:40:43 -0500 Subject: [PATCH 1/3] https://github.com/secondlife/jira-archive-internal/issues/71091 Fix for divide by zero when alpha masking a PBR material with 0 alpha. (#1044) --- indra/newview/llfetchedgltfmaterial.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); } From d1278d33ff6a47fb4102f1bfad35c5758359e975 Mon Sep 17 00:00:00 2001 From: cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:47:01 -0700 Subject: [PATCH 2/3] viewer#1051: Fix UI typos in PBR terrain error messages (#1052) --- indra/newview/skins/default/xui/en/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9f99a76bd0..8769ac9b95 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4056,7 +4056,7 @@ Replace texture [TEXTURE_NUM] with an RGB [MAX_SIZE]x[MAX_SIZE] or smaller image Couldn't set region materials: Terrain material [MATERIAL_NUM] is not loaded. -Wait for the material to load, or replace material [TEXTURE_NUM] with a valid material. +Wait for the material to load, or replace material [MATERIAL_NUM] with a valid material. Date: Mon, 25 Mar 2024 15:50:45 -0700 Subject: [PATCH 3/3] viewer#1051: Credit Ansariel for this fix --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index c902a11874..27d6574c61 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -243,6 +243,7 @@ Ansariel Hiller SL-19623 SL-4126 SL-20224 + https://github.com/secondlife/viewer/issues/1051 Aralara Rajal Arare Chantilly CHUIBUG-191