summaryrefslogtreecommitdiff
path: root/indra/newview/llsurfacepatch.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-11 01:21:42 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-11 01:21:42 +0300
commitee49b3b045e366aec466f46743214386d7fecb21 (patch)
treed5b498f2a73eb6709b5c24241549f854a14b7bb6 /indra/newview/llsurfacepatch.h
parent8f6e50ed6a8b2a3f7b2a173bf7c535aac13f22b5 (diff)
parenta73773bc1abdac6bc3beea36fd4ba58eba686e13 (diff)
Merge branch 'main' into marchcat/c-merge
# Conflicts: # indra/newview/llviewermenufile.cpp
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