diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2024-03-18 13:36:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 13:36:36 -0700 |
commit | 2a325fdebadd32a230f10b372b25ec5474e50f63 (patch) | |
tree | 7c6b0ecfe3609c213d9e73d59ba2bb74d71696f3 | |
parent | e2af6de213ff57439e008487229723d004239425 (diff) | |
parent | 3caf96b9ad10bb3c6afe5b067697809ecee51e90 (diff) |
Merge pull request #1013 from secondlife/v-1006
secondlife/viewer#1006: Prevent setting PBR terrain material swatches to null
-rw-r--r-- | doc/testplans/pbr_terrain_composition.md | 10 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 34 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_terrain.xml | 8 |
3 files changed, 29 insertions, 23 deletions
diff --git a/doc/testplans/pbr_terrain_composition.md b/doc/testplans/pbr_terrain_composition.md index 8cc5560f64..0e721c064a 100644 --- a/doc/testplans/pbr_terrain_composition.md +++ b/doc/testplans/pbr_terrain_composition.md @@ -37,7 +37,7 @@ When toggling the "PBR Metallic Roughness" checkbox to the opposite value, which - The default textures/materials - For textures, this is the default terrain texture set - - For materials, this is blank/null, but this is subject to change + - For materials, this is all blank materials, but this is subject to change - The previously applied texture/material set - History is available on a best-effort basis only. In particular, the history does not persist on viewer restart. @@ -47,15 +47,19 @@ When toggling back the "PBR Metallic Roughness" checkbox to the original value, A user with appropriate permissions can change and save the textures or materials to the terrain. If the "PBR Metallic Roughness" checkbox is checked, the user applies materials, otherwise the user applies textures. +The user should not be allowed to set the texture or material swatches to null. + Saving may fail for the following reasons: -- A terrain or material texture is invalid or null +- A terrain or material texture is invalid - A terrain texture is greater than the max texture upload resolution +If saving the terrain fails for any reason, the terrain should not be updated. + Unlike a viewer without PBR terrain support, the new viewer will no longer treat textures with alpha channels as invalid. ## Graphics Features Texture terrain with transparency will render as opaque. Parts of the texture that would be partially transparent will instead display as a mix of the color and black, depending on how transparent the texture is. -See [PBR Terrain Feature Gating](./pbr_terrain_feature_gating.md) for supported PBR terrain features. +See [PBR Terrain Appearance](./pbr_terrain_appearance.md) for supported PBR terrain features. diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5de11d6699..8c4b6fc857 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -62,6 +62,7 @@ #include "llfloaterreg.h" #include "llfloaterregiondebugconsole.h" #include "llfloatertelehub.h" +#include "llgltfmateriallist.h" #include "llinventorymodel.h" #include "lllineeditor.h" #include "llnamelistctrl.h" @@ -1394,7 +1395,7 @@ LLPanelRegionTerrainInfo::LLPanelRegionTerrainInfo() } for (S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - mLastSetMaterials[i] = LLUUID::null; + mLastSetMaterials[i] = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID; } } @@ -1633,21 +1634,6 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) BOOL LLPanelRegionTerrainInfo::sendUpdate() { LL_INFOS() << "LLPanelRegionTerrainInfo::sendUpdate" << LL_ENDL; - std::string buffer; - strings_t strings; - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - - // update the model - LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); - region_info.mWaterHeight = (F32) getChild<LLUICtrl>("water_height_spin")->getValue().asReal(); - region_info.mTerrainRaiseLimit = (F32) getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal(); - region_info.mTerrainLowerLimit = (F32) getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal(); - - // and sync the region with it - region_info.sendRegionTerrain(invoice); - - // ======================================= - // Assemble and send texturedetail message // Make sure user hasn't chosen wacky textures. if (!validateTextureSizes()) @@ -1670,6 +1656,22 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() } } + std::string buffer; + strings_t strings; + LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); + + // update the model + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + region_info.mWaterHeight = (F32) getChild<LLUICtrl>("water_height_spin")->getValue().asReal(); + region_info.mTerrainRaiseLimit = (F32) getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal(); + region_info.mTerrainLowerLimit = (F32) getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal(); + + // and sync the region with it + region_info.sendRegionTerrain(invoice); + + // ======================================= + // Assemble and send texturedetail message + std::string id_str; LLMessageSystem* msg = gMessageSystem; 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 38d885d72d..4a2c0d42b9 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -161,7 +161,7 @@ left="10" name="material_detail_0" pick_type="material" - allow_no_texture="true" + default_image_id="968cbad0-4dad-d64e-71b5-72bf13ad051a" top_delta="0" width="100" /> <texture_picker @@ -172,7 +172,7 @@ left_pad="10" name="material_detail_1" pick_type="material" - allow_no_texture="true" + default_image_id="968cbad0-4dad-d64e-71b5-72bf13ad051a" top_delta="0" width="100" /> <texture_picker @@ -183,7 +183,7 @@ left_pad="10" name="material_detail_2" pick_type="material" - allow_no_texture="true" + default_image_id="968cbad0-4dad-d64e-71b5-72bf13ad051a" top_delta="0" width="100" /> <texture_picker @@ -194,7 +194,7 @@ left_pad="10" name="material_detail_3" pick_type="material" - allow_no_texture="true" + default_image_id="968cbad0-4dad-d64e-71b5-72bf13ad051a" top_delta="0" width="100" /> <text |