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

Function TriangleLerp

BakingLab/PathTracer.cpp:62–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)
63{
64 const uint64 triangleIdx = ray.primID;
65 const Uint3& triangle = bvhData.Triangles[triangleIdx];
66 const T& v0 = vertexData[triangle.x];
67 const T& v1 = vertexData[triangle.y];
68 const T& v2 = vertexData[triangle.z];
69
70 return BarycentricLerp(v0, v1, v2, ray.u, ray.v);
71}
72
73// Returns the direct sun radiance for a direction on the skydome
74static Float3 SampleSun(Float3 sampleDir)

Callers 1

PathTraceFunction · 0.85

Calls 1

BarycentricLerpFunction · 0.85

Tested by

no test coverage detected