How to calculate numAttributeValues of OptixPipelineCompileOptions ?


In OptiX 7 examples, optixRaycasting example sets numAttributeValues as 2, but optixTriangle example sets it as 3. Since they are both triangle raytracing without custom reportIntersection, why there is difference?

How to understand and calculate this value?

It’s the maximum of 2 for the built-in triangle barycentrics and the maximum number of attribute registers you use with the optixReportIntersection() functions inside a pipeline.

If the optixTriangle example is using the built-in triangles only, that numAttributeValues should have been 2.