Skip to contentConstants
closestPointToTriangleWGSL function node that finds the closest point on a triangle to p and returns the barycoord.intersectRayTriangleWGSL function node that tests a ray against a single triangle and returns an rayIntersectionResultStruct result.ndcToCameraRayWGSL function node that builds a camera ray (origin + far-plane direction) from an NDC coordinate and an inverse model-view-projection matrix.pointQueryResultStructWGSL struct node describing a closest-point query result, including the world-space closest point, squared distance, barycentric coordinates, face normal, side, triangle indices,…rayIntersectionResultStructWGSL struct node describing a ray–triangle intersection result, including barycentric coordinates, world-space normal, hit distance, face side, triangle indices, and the object in…rayStructWGSL struct node representing a ray with an origin, direction, and maximum trace distance.