summaryrefslogtreecommitdiff
path: root/indra/newview/llsurfacepatch.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-05-29 12:35:27 +0800
committerErik Kundiman <erik@megapahit.org>2025-05-29 12:35:27 +0800
commitd046d7e0e1e3ccbffb42d22fe52aa73d0c170b8e (patch)
tree7c2023e55955c9aed55db9331bae164a386a2d21 /indra/newview/llsurfacepatch.cpp
parent6641e36082f27faa282a0af6f88f381ffc97e179 (diff)
parent11d75418fce8372e9976b069070d9d0506766d0d (diff)
Merge branch 'main' into 2025.05
Diffstat (limited to 'indra/newview/llsurfacepatch.cpp')
-rw-r--r--indra/newview/llsurfacepatch.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp
index 4315c4c6b0..875af76c10 100644
--- a/indra/newview/llsurfacepatch.cpp
+++ b/indra/newview/llsurfacepatch.cpp
@@ -201,7 +201,7 @@ LLVector2 LLSurfacePatch::getTexCoords(const U32 x, const U32 y) const
void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 *vertex, LLVector3 *normal,
- LLVector2 *tex1) const
+ LLVector2* tex0, LLVector2 *tex1) const
{
if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge() || !mVObjp)
{
@@ -220,6 +220,12 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3
pos_agent.mV[VZ] = *(mDataZ + point_offset);
*vertex = pos_agent-mVObjp->getRegion()->getOriginAgent();
+ // tex0 is used for ownership overlay
+ LLVector3 rel_pos = pos_agent - mSurfacep->getOriginAgent();
+ LLVector3 tex_pos = rel_pos * (1.f / (surface_stride * mSurfacep->getMetersPerGrid()));
+ tex0->mV[0] = tex_pos.mV[0];
+ tex0->mV[1] = tex_pos.mV[1];
+
tex1->mV[0] = mSurfacep->getRegion()->getCompositionXY(llfloor(mOriginRegion.mV[0])+x, llfloor(mOriginRegion.mV[1])+y);
const F32 xyScale = 4.9215f*7.f; //0.93284f;