summaryrefslogtreecommitdiff
path: root/indra/newview/llsurfacepatch.h
diff options
context:
space:
mode:
authorBrad Linden <46733234+brad-linden@users.noreply.github.com>2024-02-09 09:47:19 -0800
committerGitHub <noreply@github.com>2024-02-09 09:47:19 -0800
commit846337483c0d3cce0607efe2ff17ed04dc90801f (patch)
tree9adb6550e3d81de000f31791ea3e302cc23a4d7a /indra/newview/llsurfacepatch.h
parent23d44cb6653ee4ca46ec0e33f19b393b58f5332f (diff)
parentd6048bfcb2442ca7ec278864b9827d74873efa3a (diff)
Merge branch 'release/materials_featurette' into release/gltf-maint2
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 8c8f501dce..ec3864ce44 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