summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2024-01-23 13:12:54 -0800
committerCosmic Linden <cosmic@lindenlab.com>2024-01-23 13:12:54 -0800
commit7b0372ac1f6191ef9216296cef2f476caadee40c (patch)
tree575757798bdf15d9c58e8e17e5f170de2e074b7a /indra/newview/llfloaterregioninfo.cpp
parent38b3f663fc3214314b75e19fbc25474007479897 (diff)
Put PBR terrain behind feature flag
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--indra/newview/llfloaterregioninfo.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 15ac46dc21..2c743d596e 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1441,32 +1441,45 @@ BOOL LLPanelRegionTerrainInfo::postBuild()
mAskedTextureHeights = false;
mConfirmedTextureHeights = false;
+ refresh();
+
return LLPanelRegionInfo::postBuild();
}
// virtual
void LLPanelRegionTerrainInfo::refresh()
{
- std::string buffer;
+ // For simplicity, require restart
+ static BOOL feature_pbr_terrain_enabled = gSavedSettings.getBOOL("RenderTerrainPBREnabled");
- bool has_material_assets = false;
- for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
- {
- buffer = llformat("material_detail_%d", i);
- LLTextureCtrl* material_ctrl = getChild<LLTextureCtrl>(buffer);
- if (material_ctrl && material_ctrl->getImageAssetID().notNull())
- {
- has_material_assets = true;
- break;
- }
- }
+ LLTextBox* texture_text = getChild<LLTextBox>("detail_texture_text");
+ if (texture_text) { texture_text->setVisible(!feature_pbr_terrain_enabled); }
LLComboBox* material_type_ctrl = getChild<LLComboBox>("terrain_material_type");
if (material_type_ctrl)
{
- const TerrainMaterialType material_type = material_type_from_index(material_type_ctrl->getCurrentIndex());
+ material_type_ctrl->setVisible(feature_pbr_terrain_enabled);
+
+ bool has_material_assets = false;
+
+ std::string buffer;
+ for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
+ {
+ buffer = llformat("material_detail_%d", i);
+ LLTextureCtrl* material_ctrl = getChild<LLTextureCtrl>(buffer);
+ if (material_ctrl && material_ctrl->getImageAssetID().notNull())
+ {
+ has_material_assets = true;
+ break;
+ }
+ }
+
+ TerrainMaterialType material_type = material_type_from_index(material_type_ctrl->getCurrentIndex());
+
+ if (!feature_pbr_terrain_enabled) { material_type = TerrainMaterialType::TEXTURE; }
+
const bool is_material_selected = material_type == TerrainMaterialType::PBR_MATERIAL;
- material_type_ctrl->setEnabled(!(is_material_selected && has_material_assets));
+ material_type_ctrl->setEnabled(feature_pbr_terrain_enabled && !(is_material_selected && has_material_assets));
}
}