How to obtain the barycentric coordinates of the intersection? #1195
-
Hi there, When I use Is there a way to obtain the barycentric coordinates? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @woAIxuexiSR Indeed, the If you need this information, I think the easiest way is to add an extra field to the |
Beta Was this translation helpful? Give feedback.
Hi @woAIxuexiSR
Indeed, the
SurfaceInteraction3f
struct only holds barycentric coordinates in itsuv
field if the mesh is untextured. If the mesh is textured, thenuv
is the texture coordinate.You could theoretically recompute the barycentric coordinates from the
si.p
andsi.prim_index
fields, but that would require access to the mesh's datastructures.If you need this information, I think the easiest way is to add an extra field to the
SurfaceInteraction3f
struct, fill it during the ray-intersection routing and apply that change wherever required.