NAME
MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates - Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the index of the intersected instance, and the first two barycentric coordinates of the intersection point.
SYNOPSIS
#include <MPSRayIntersectorTypes.h>
Public Attributes
float distance
Distance from the ray origin to the intersection point along the ray direction
vector such that intersection = ray.origin + ray.direction * distance. Is
negative if there is no intersection. If the intersection type is
MPSIntersectionTypeAny, is a positive value for a hit or a negative value
for a miss. unsigned int primitiveIndex
Index of the intersected primitive. Undefined if the ray does not intersect a
primitive or if the intersection type is MPSIntersectionTypeAny. unsigned
int instanceIndex
Index of the intersected instance. Undefined if the ray does not intersect a
primitive, if the acceleration structure is not an instance acceleration
structure, or if the intersection type is MPSIntersectionTypeAny.
vector_float2 coordinates
The first two barycentric coordinates U and V of the intersection point. The
third coordinate W = 1 - U - V. Undefined if the ray does not intersect a
primitive or if the intersection type is MPSIntersectionTypeAny.
Detailed Description
Intersection result which contains the distance from the ray origin to the intersection point, the index of the intersected primitive, the index of the intersected instance, and the first two barycentric coordinates of the intersection point.
This type is available from the Metal Shading Language by including the MetalPerformanceShaders/MetalPerformanceShaders.h header.
Member Data Documentation
vector_float2 MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates::coordinates
The first two barycentric coordinates U and V of the intersection point. The third coordinate W = 1 - U - V. Undefined if the ray does not intersect a primitive or if the intersection type is MPSIntersectionTypeAny.
float MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates::distance
Distance from the ray origin to the intersection point along the ray direction vector such that intersection = ray.origin + ray.direction * distance. Is negative if there is no intersection. If the intersection type is MPSIntersectionTypeAny, is a positive value for a hit or a negative value for a miss.
unsigned int MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates::instanceIndex
Index of the intersected instance. Undefined if the ray does not intersect a primitive, if the acceleration structure is not an instance acceleration structure, or if the intersection type is MPSIntersectionTypeAny.
unsigned int MPSIntersectionDistancePrimitiveIndexInstanceIndexCoordinates::primitiveIndex
Index of the intersected primitive. Undefined if the ray does not intersect a primitive or if the intersection type is MPSIntersectionTypeAny.
Author
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.