Using Embree 3.6.1 (github tab) is very nice and I get nice intersection, but as soon as I want to use PrimID, It seems I hit a wall.
There's not much documentation
I'm using it with a triangle mesh, feeded with srcIndices and srcVertices, just vertex and index.
When I get a hit, I can see it looks good (if I draw white dot for each hit I get mesh shapre) but as soon as
I use prim ID to get back to my data, I get very strange results
const unsigned int triSrcPos = ray.hit.primID* 3;
const Vertex &v0Src = srcVertices[srcIndices[triSrcPos + 0]];
const Vertex &v1Src = srcVertices[srcIndices[triSrcPos + 1]];
const Vertex &v2Src = srcVertices[srcIndices[triSrcPos + 2]];
... then I use it for getting texture of that triangle
v0Src.texID <= not good results
Same for texcoord, doesn't seem to be the good ones
Perhaps I misunderstood PrimID, it not a value of "index of triangles" in this case ?
If there's anything I missed that makes PrimID relevant, it would help a lot, thanks!
btw, Embree is great work.