MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / BarycentricLerp

Function BarycentricLerp

BakingLab/PathTracer.cpp:56–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55// Interpolates 3 vertex values using barycentric coordinates
56template<typename T> T BarycentricLerp(const T& v0, const T& v1, const T& v2, float u, float v)
57{
58 return v0 + (v1 - v0) * u + (v2 - v0) * v;
59}
60
61// Interpolates triangle vertex values using the barycentric coordinates from a BVH hit result
62template<typename T> T TriangleLerp(const EmbreeRay& ray, const BVHData& bvhData, const std::vector<T>& vertexData)

Callers 1

TriangleLerpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected