KhronosGroup / ANARI-Docs

ANARI Documentation
Other
31 stars 8 forks source link

Add colormap sampler #81

Closed jeffamstutz closed 1 year ago

jeffamstutz commented 1 year ago

VisRTX currently implements a colormap sampler subtype which as proven to be useful in scivis applications (specifically VTK-m). It essentially applies the same value color mapping operation that the transferFunction1D does to volume data but instead on geometry attributes.

This issue proposes the following sampler extension text be added to the spec (roughly speaking, wording to be improved):

The KHR_SAMPLER_COLOR_MAP extension indicates that an additional sampler subtype is available: "colorMap". This sampler takes the first channel of the input attribute and applies a transfer function (normalization + color) to it. This sampler has the following parameters in addition to the base ANARI sampler parameters:

Name Type Default Description
color ARRAY1D of Color array to map sampled and clamped field values to color
valueRange FLOAT32_BOX1 [0,1] input attribute values are clamped to this range

This sampler follows the same rules for the color parameter as they are found on the "transferFunction1D" volume subtype. Values from this sampler are output as VEC3(r, g, b, 1) to the input of the material where the sampler used, where r, g, and b come from the values in color respectively.