| 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) |
| 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 |
| 74 | static Float3 SampleSun(Float3 sampleDir) |
no test coverage detected