summaryrefslogtreecommitdiff
path: root/indra/newview/llvlcomposition.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvlcomposition.h')
-rw-r--r--indra/newview/llvlcomposition.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llvlcomposition.h b/indra/newview/llvlcomposition.h
index cd5104d5a5..763ff69442 100644
--- a/indra/newview/llvlcomposition.h
+++ b/indra/newview/llvlcomposition.h
@@ -35,9 +35,16 @@
class LLSurface;
class LLViewerFetchedTexture;
+class LLGLTFMaterial;
class LLFetchedGLTFMaterial;
-class LLTerrainMaterials
+class LLModifyRegion
+{
+public:
+ virtual const LLGLTFMaterial* getMaterialOverride(S32 asset) const = 0;
+};
+
+class LLTerrainMaterials : public LLModifyRegion
{
public:
friend class LLDrawPoolTerrain;
@@ -45,6 +52,8 @@ public:
LLTerrainMaterials();
virtual ~LLTerrainMaterials();
+ void apply(const LLModifyRegion& other);
+
// Heights map into textures (or materials) as 0-1 = first, 1-2 = second, etc.
// So we need to compress heights into this range.
static const S32 ASSET_COUNT = 4;
@@ -62,6 +71,8 @@ public:
virtual LLUUID getDetailAssetID(S32 asset);
virtual void setDetailAssetID(S32 asset, const LLUUID& id);
+ const LLGLTFMaterial* getMaterialOverride(S32 asset) const override;
+ virtual void setMaterialOverride(S32 asset, LLGLTFMaterial* mat_override);
Type getMaterialType();
bool texturesReady(bool boost, bool strict);
// strict = true -> all materials must be sufficiently loaded
@@ -74,8 +85,13 @@ protected:
// strict = true -> all materials must be sufficiently loaded
// strict = false -> at least one material must be loaded
static bool materialReady(LLPointer<LLFetchedGLTFMaterial>& mat, bool& textures_set, bool boost, bool strict);
+ // *NOTE: Prefer calling materialReady if mat is known to be LLFetchedGLTFMaterial
+ static bool materialTexturesReady(LLPointer<LLFetchedGLTFMaterial>& mat, bool& textures_set, bool boost, bool strict);
+
LLPointer<LLViewerFetchedTexture> mDetailTextures[ASSET_COUNT];
LLPointer<LLFetchedGLTFMaterial> mDetailMaterials[ASSET_COUNT];
+ LLPointer<LLGLTFMaterial> mDetailMaterialOverrides[ASSET_COUNT];
+ LLPointer<LLFetchedGLTFMaterial> mDetailRenderMaterials[ASSET_COUNT];
bool mMaterialTexturesSet[ASSET_COUNT];
};
@@ -124,9 +140,6 @@ public:
bool getParamsReady() const { return mParamsReady; }
protected:
- static bool textureReady(LLPointer<LLViewerFetchedTexture>& tex, bool boost = false);
- static bool materialReady(LLPointer<LLFetchedGLTFMaterial>& mat, bool& textures_set, bool boost = false);
-
bool mParamsReady = false;
LLSurface *mSurfacep;