How to calculate numAttributeValues of OptixPipelineCompileOptions ?

Hi,

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.
https://raytracing-docs.nvidia.com/optix7/guide/index.html#device_side_functions#reporting-intersections-and-attribute-access
https://raytracing-docs.nvidia.com/optix7/api/html/struct_optix_pipeline_compile_options.html#aeed3da36b118f4c7842d62cb44c374e2

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