summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llfloaterregioninfo.cpp41
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_terrain.xml16
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 @@
<key>Value</key>
<real>12.0</real>
</map>
+ <key>RenderTerrainPBREnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>EXPERIMENTAL: Enable PBR Terrain features. Requires restart.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RenderTerrainPBRDetail</key>
<map>
<key>Comment</key>
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));
}
}
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
@@ -95,6 +95,20 @@
<text
type="string"
length="1"
+ follows="left|top"
+ halign="left"
+ valign="center"
+ height="20"
+ layout="topleft"
+ name="detail_texture_text"
+ top_delta="0"
+ left_delta="0"
+ width="170">
+ Terrain Textures
+ </text>
+ <text
+ type="string"
+ length="1"
halign="left"
valign="center"
follows="left|top"
@@ -102,7 +116,7 @@
layout="topleft"
top_delta="0"
left_delta="180"
- name="detail_texture_text"
+ name="detail_texture_limits_text"
width="200">
Maximum size: 1024x1024
</text>