KhronosGroup / ANARI-Docs

ANARI Documentation
Other
31 stars 8 forks source link

The double use of primitiveID #104

Closed progschj closed 1 year ago

progschj commented 1 year ago

Geometries have a primitive.id array which can be set to either a uint32 or uint64 array.

The primitive ID is currently used to index in a primitive sampler but is also written to the primitiveId channel in the frame if that is supported and enabled.

However despite the array allowing uint64 the framebuffer channel can only be specified as ANARI_UINT32 which seems odd. Also the two use cases seem to conflict with each other. If the ids are set for use with the primitive sampler those values are unlikely to be the same ones one would want to use for picking purposes. The primitiveId remapping has to happen inside ANARI for the sampler use case. The id translation in the framebuffer channel on the other hand is trivially achievable outside ANARI by performing the lookup with the exact same lookup table that needs to be constructed to pass it to the primitive.id geometry parameter anyway.

Should the primitiveId framebuffer channel reflect the non-remapped primitive indices?

progschj commented 1 year ago

In the WG call we discussed that the most likely errata for this is to remove the primitive.id parameter from the geometries since the ability to remap the primitiveId was a holdover from a slightly different design for picking and seems vestigial now.