summaryrefslogtreecommitdiff
path: root/indra/newview/llvlcomposition.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-10-13 10:38:42 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-10-13 10:38:42 -0700
commitb9ba57fd0004751dfbcbea90264a6e16c5849e5e (patch)
tree49f3da7af8ecc47ec5c1a3505360a0df13203d1f /indra/newview/llvlcomposition.cpp
parent57433341abffba9382e6899b164af40200f5d6d3 (diff)
DRTVWR-592: (WIP) Fix terrain PBR texture repeat seam. Legacy terrain texture repeats currently broken
Diffstat (limited to 'indra/newview/llvlcomposition.cpp')
-rw-r--r--indra/newview/llvlcomposition.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index 8cd22e3bdb..130d74b286 100644
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -119,7 +119,7 @@ void LLTerrainMaterials::setDetailAssetID(S32 asset, const LLUUID& id)
mMaterialTexturesSet[asset] = false;
}
-BOOL LLTerrainMaterials::getMaterialType()
+LLTerrainMaterials::Type LLTerrainMaterials::getMaterialType()
{
return mMaterialType;
}
@@ -132,7 +132,6 @@ void LLTerrainMaterials::updateMaterialType()
mMaterialType = use_textures ? Type::TEXTURE : Type::PBR;
}
-
BOOL LLTerrainMaterials::texturesReady(BOOL boost)
{
for (S32 i = 0; i < ASSET_COUNT; i++)
@@ -408,7 +407,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
U8* st_data[ASSET_COUNT];
S32 st_data_size[ASSET_COUNT]; // for debugging
- const bool use_textures = getMaterialType() != LLTerrainMaterial::Type::PBR;
+ const bool use_textures = getMaterialType() != LLTerrainMaterials::Type::PBR;
for (S32 i = 0; i < ASSET_COUNT; i++)
{
@@ -423,8 +422,9 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
else
{
tex = mDetailMaterials[i]->mBaseColorTexture;
- if (!tex) { tex = LLViewerFetchedTexture::sWhiteImagep; }
}
+ // TODO: Why are terrain textures (not terrain materials) not loading? (that is why there is a getComponents() check here)
+ if (!tex || tex->getComponents() == 0) { tex = LLViewerFetchedTexture::sWhiteImagep; }
S32 min_dim = llmin(tex->getFullWidth(), tex->getFullHeight());
S32 ddiscard = 0;