From 7b0372ac1f6191ef9216296cef2f476caadee40c Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Tue, 23 Jan 2024 13:12:54 -0800 Subject: Put PBR terrain behind feature flag --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llfloaterregioninfo.cpp | 41 ++++++++++++++-------- .../skins/default/xui/en/panel_region_terrain.xml | 16 ++++++++- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 578bb02387..df30b8d298 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10833,6 +10833,17 @@ Value 12.0 + RenderTerrainPBREnabled + + Comment + EXPERIMENTAL: Enable PBR Terrain features. Requires restart. + Persist + 1 + Type + Boolean + Value + 0 + RenderTerrainPBRDetail Comment 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(buffer); - if (material_ctrl && material_ctrl->getImageAssetID().notNull()) - { - has_material_assets = true; - break; - } - } + LLTextBox* texture_text = getChild("detail_texture_text"); + if (texture_text) { texture_text->setVisible(!feature_pbr_terrain_enabled); } LLComboBox* material_type_ctrl = getChild("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(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)); } } diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml index e36fb05647..88855ab739 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -92,6 +92,20 @@ name="PBRMaterials" value="PBRMaterials" /> + + Terrain Textures + Maximum size: 1024x1024 -- cgit v1.2.3