summaryrefslogtreecommitdiff
path: root/indra/newview/llsurfacepatch.h
diff options
context:
space:
mode:
authorRoxanne Skelly <roxie@lindenlab.com>2024-06-11 23:18:54 -0700
committerGitHub <noreply@github.com>2024-06-11 23:18:54 -0700
commit0f3c3563b0861e8ea82b201aab8343d99f993bbc (patch)
tree7ab124cd4852f2d36bf897090feff5cf29c3ebc7 /indra/newview/llsurfacepatch.h
parent6a00609b0cede78f998971687a756b7fcf826c0f (diff)
parented34782283aa2ae6a7a76c0492a2f9edc6bb3629 (diff)
Merge pull request #1726 from secondlife/roxie/webrtc-voice
Merge from main.
Diffstat (limited to 'indra/newview/llsurfacepatch.h')
-rw-r--r--indra/newview/llsurfacepatch.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h
index 43843aba0b..94d471b43d 100644
--- a/indra/newview/llsurfacepatch.h
+++ b/indra/newview/llsurfacepatch.h
@@ -77,6 +77,7 @@ public:
void updateVerticalStats();
void updateCompositionStats();
+ template<bool PBR>
void updateNormals();
void updateEastEdge();
@@ -102,9 +103,18 @@ public:
LLVector3 getPointAgent(const U32 x, const U32 y) const; // get the point at the offset.
LLVector2 getTexCoords(const U32 x, const U32 y) const;
+ // Per-vertex normals
+ // *TODO: PBR=true is a test implementation solely for proof-of-concept.
+ // Final implementation would likely be very different and may not even use
+ // this function. If we decide to keep calcNormalFlat, remove index as it
+ // is a debug parameter for testing.
+ template<bool PBR>
void calcNormal(const U32 x, const U32 y, const U32 stride);
const LLVector3 &getNormal(const U32 x, const U32 y) const;
+ // Per-triangle normals for flat edges
+ void calcNormalFlat(LLVector3& normal_out, const U32 x, const U32 y, const U32 index /* 0 or 1 */);
+
void eval(const U32 x, const U32 y, const U32 stride,
LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex0, LLVector2 *tex1);
@@ -181,5 +191,8 @@ protected:
LLSurface *mSurfacep; // Pointer to "parent" surface
};
+extern template void LLSurfacePatch::updateNormals</*PBR=*/false>();
+extern template void LLSurfacePatch::updateNormals</*PBR=*/true>();
+
#endif // LL_LLSURFACEPATCH_H