summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmaterialpreviewmgr.cpp
diff options
context:
space:
mode:
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;