summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmaterialpreviewmgr.cpp
diff options
context:
space:
mode:
authorcosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2024-02-09 07:16:01 -0800
committerGitHub <noreply@github.com>2024-02-09 09:16:01 -0600
commitd6048bfcb2442ca7ec278864b9827d74873efa3a (patch)
tree9a76192342b7ca42ae754d9518606b2545109ca3 /indra/newview/llgltfmaterialpreviewmgr.cpp
parente24f631110c4fb3ca135b6d6dfaa448062e2f9bd (diff)
Put PBR material swatch behind feature flag (#775)
* secondlife/viewer#771: Put PBR material swatch behind feature flag * secondlife/viewer#771: Make viewer respect PBRMaterialSwatchEnabled from SimulatorFeatures
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r--indra/newview/llgltfmaterialpreviewmgr.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp
index 53d9d7d0ba..901db87eed 100644
--- a/indra/newview/llgltfmaterialpreviewmgr.cpp
+++ b/indra/newview/llgltfmaterialpreviewmgr.cpp
@@ -543,7 +543,6 @@ void LLGLTFPreviewTexture::postRender(BOOL success)
LLViewerDynamicTexture::postRender(success);
}
-// static
LLPointer<LLViewerTexture> LLGLTFMaterialPreviewMgr::getPreview(LLPointer<LLFetchedGLTFMaterial> &material)
{
if (!material)
@@ -551,6 +550,13 @@ LLPointer<LLViewerTexture> LLGLTFMaterialPreviewMgr::getPreview(LLPointer<LLFetc
return nullptr;
}
+ static LLCachedControl<bool> sUIPreviewMaterial(gSavedSettings, "UIPreviewMaterial", false);
+ if (!sUIPreviewMaterial)
+ {
+ fetch_texture_for_ui(material->mBaseColorTexture, material->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR]);
+ return material->mBaseColorTexture;
+ }
+
if (!is_material_loaded_enough_for_ui(*material))
{
return nullptr;