| 54 | |
| 55 | // Interpolates 3 vertex values using barycentric coordinates |
| 56 | template<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 |
| 62 | template<typename T> T TriangleLerp(const EmbreeRay& ray, const BVHData& bvhData, const std::vector<T>& vertexData) |