Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)

Barycentric coordinates u v order

JeanBon1
Novice
624 Views
Hi, When intersecting with Embree, we get the u and v coordinates of the hit on the geometric shape (a triangle as far as i am concerned). Many sources will tell that the world coordinate is P1 = V0 * u + V1 * v + V2 * (1-u-v) and others P2 = V0 * (1-u-v) + V1 * u + V2 * v; In my scene, it is P2 that is correct and not P1. How to make sure which one I should use in Embree ? Is P1 always incorrect ? Thanks for the clarification,
0 Kudos
2 Replies
SvenW_Intel
Moderator
603 Views

Embree always uses the second formula (V0 * (1-u-v) + V1 * u + V2 * v) for triangles. Please also see documentation section RTC_GEOMETRY_TYPE_TRIANGLE.

JeanBon1
Novice
591 Views

Thanks!

For some reasons I skipped the explanation in the doc.

My ray tracer works beautifully now. +1

 

 

0 Kudos
Reply