summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-27 20:01:52 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-27 20:01:52 -0700
commitd8dd4d9c0cd4554704cbe15b5502f4d87a4674ad (patch)
treea359cdd5b39994cf04a4370718bcaeb8a73a9613 /indra/llprimitive
parentdb485adbeb1c7a7d64fbddd124f7f4c73214ef99 (diff)
Just about got hero reflection maps working.
DRTVWR-583
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llprimitive.cpp5
-rw-r--r--indra/llprimitive/llprimitive.h1
-rw-r--r--indra/llprimitive/llprimtexturelist.cpp10
-rw-r--r--indra/llprimitive/llprimtexturelist.h1
-rw-r--r--indra/llprimitive/lltextureentry.cpp19
-rw-r--r--indra/llprimitive/lltextureentry.h12
6 files changed, 47 insertions, 1 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 5dfce4ae16..b45ead92d3 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -404,6 +404,11 @@ S32 LLPrimitive::setTEFullbright(const U8 index, const U8 fullbright)
return mTextureList.setFullbright(index, fullbright);
}
+S32 LLPrimitive::setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target)
+{
+ return mTextureList.setRenderableTarget(te, target);
+}
+
S32 LLPrimitive::setTEMediaFlags(const U8 index, const U8 media_flags)
{
return mTextureList.setMediaFlags(index, media_flags);
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index d2adfa4a3d..520c7c7ac8 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -485,6 +485,7 @@ public:
virtual S32 setTETexGen(const U8 te, const U8 texgen);
virtual S32 setTEShiny(const U8 te, const U8 shiny);
virtual S32 setTEFullbright(const U8 te, const U8 fullbright);
+ virtual S32 setTERenderableTarget(const U8 te, const LLTextureEntry::eRenderableTarget target);
virtual S32 setTEMediaFlags(const U8 te, const U8 flags);
virtual S32 setTEGlow(const U8 te, const F32 glow);
virtual S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp
index f4f08248b8..49b59e35cb 100644
--- a/indra/llprimitive/llprimtexturelist.cpp
+++ b/indra/llprimitive/llprimtexturelist.cpp
@@ -341,6 +341,16 @@ S32 LLPrimTextureList::setFullbright(const U8 index, const U8 fullbright)
return TEM_CHANGE_NONE;
}
+S32 LLPrimTextureList::setRenderableTarget(const U8 index, const U8 target)
+{
+ if (index < mEntryList.size())
+ {
+ return mEntryList[index]->setRenderableTarget((LLTextureEntry::eRenderableTarget)target);
+ }
+
+ return TEM_CHANGE_NONE;
+}
+
S32 LLPrimTextureList::setMediaFlags(const U8 index, const U8 media_flags)
{
if (index < mEntryList.size())
diff --git a/indra/llprimitive/llprimtexturelist.h b/indra/llprimitive/llprimtexturelist.h
index 49c636e40f..34b87d879f 100644
--- a/indra/llprimitive/llprimtexturelist.h
+++ b/indra/llprimitive/llprimtexturelist.h
@@ -102,6 +102,7 @@ public:
S32 setTexGen(const U8 index, const U8 texgen);
S32 setShiny(const U8 index, const U8 shiny);
S32 setFullbright(const U8 index, const U8 t);
+ S32 setRenderableTarget(const U8 index, const U8 target);
S32 setMediaFlags(const U8 index, const U8 media_flags);
S32 setGlow(const U8 index, const F32 glow);
S32 setMaterialID(const U8 index, const LLMaterialID& pMaterialID);
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 71caff1686..d057e5ab29 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -504,6 +504,16 @@ S32 LLTextureEntry::setFullbright(U8 fullbright)
return TEM_CHANGE_NONE;
}
+S32 LLTextureEntry::setRenderableTarget(eRenderableTarget target)
+{
+ if (getRenderableTarget() != target) {
+ mRenderableTarget = target;
+ return TEM_CHANGE_TEXTURE;
+ }
+
+ return TEM_CHANGE_NONE;
+}
+
S32 LLTextureEntry::setShiny(U8 shiny)
{
shiny &= TEM_SHINY_MASK;
@@ -685,6 +695,15 @@ S32 LLTextureEntry::setMaterialParams(const LLMaterialPtr pMaterialParams)
mMaterialUpdatePending = true;
}
mMaterial = pMaterialParams;
+
+ // TODO: GZ: We should avoid magic UUIDs in the future, but for development we're using one for the time being. Remove this later.
+ if (mMaterial->getSpecularID().asString() == "da7ecda1-e780-423f-ce27-26df7dc69cb6")
+ {
+ setRenderableTarget(RT_MIRROR);
+ } else {
+ setRenderableTarget(RT_DISABLED);
+ }
+
return TEM_CHANGE_TEXTURE;
}
diff --git a/indra/llprimitive/lltextureentry.h b/indra/llprimitive/lltextureentry.h
index f5f2c0172d..2c0832e1d4 100644
--- a/indra/llprimitive/lltextureentry.h
+++ b/indra/llprimitive/lltextureentry.h
@@ -80,6 +80,12 @@ public:
TEX_GEN_SPHERICAL = 0x04,
TEX_GEN_CYLINDRICAL = 0x06
} eTexGen;
+
+
+ typedef enum e_renderable_target {
+ RT_DISABLED = 0x00,
+ RT_MIRROR = 0x02
+ } eRenderableTarget;
LLTextureEntry();
LLTextureEntry(const LLUUID& tex_id);
@@ -134,7 +140,9 @@ public:
S32 setGlow(F32 glow);
S32 setMaterialID(const LLMaterialID& pMaterialID);
S32 setMaterialParams(const LLMaterialPtr pMaterialParams);
-
+
+ S32 setRenderableTarget(eRenderableTarget target);
+
virtual const LLUUID &getID() const { return mID; }
const LLColor4 &getColor() const { return mColor; }
const F32 getAlpha() const { return mColor.mV[VALPHA]; }
@@ -152,6 +160,7 @@ public:
U8 getBumpmap() const { return mBump & TEM_BUMP_MASK; }
U8 getFullbright() const { return (mBump>>TEM_FULLBRIGHT_SHIFT) & TEM_FULLBRIGHT_MASK; }
+ eRenderableTarget getRenderableTarget() const { return mRenderableTarget; }
U8 getShiny() const { return (mBump>>TEM_SHINY_SHIFT) & TEM_SHINY_MASK; }
U8 getBumpShiny() const { return mBump & TEM_BUMP_SHINY_MASK; }
U8 getBumpShinyFullbright() const { return mBump; }
@@ -233,6 +242,7 @@ protected:
LLColor4 mColor;
U8 mBump; // Bump map, shiny, and fullbright
U8 mMediaFlags; // replace with web page, movie, etc.
+ eRenderableTarget mRenderableTarget;
F32 mGlow;
bool mMaterialUpdatePending;
LLMaterialID mMaterialID;