Note that for UVOnly sample type, an internal UV-space BVTree will be constructed, and each sample will query that to find the UV/3D correspondence. If you already know the TriangleID, you can use the TriangleAndUV type to avoid the BVTree construction and queries.