KhronosGroup / ANARI-Docs

ANARI Documentation
Other
31 stars 8 forks source link

Standardized renderer background color #51

Closed jeffamstutz closed 1 year ago

progschj commented 1 year ago

For plain colors some devices support a backgroundColor currently. Additionally a backplate image allows inserting images and gradients (tiny images with linear filtering).

{
    "type" : "ANARI_RENDERER",
    "name" : "default",
    "parameters" : [
        {
            "name" : "backgroundColor",
            "types" : ["ANARI_FLOAT32_VEC4"],
            "tags" : [],
            "default" : [1,1,1,1],
            "description" : "Clear color"
        }, {
            "name" : "backplate",
            "types" : ["ANARI_ARRAY2D"],
            "elementType" : [
                "ANARI_UFIXED8", "ANARI_UFIXED8_VEC2", "ANARI_UFIXED8_VEC3", "ANARI_UFIXED8_VEC4",
                "ANARI_UFIXED8_R_SRGB", "ANARI_UFIXED8_RA_SRGB", "ANARI_UFIXED8_RGB_SRGB", "ANARI_UFIXED8_RGBA_SRGB",
                "ANARI_UFIXED16", "ANARI_UFIXED16_VEC2", "ANARI_UFIXED16_VEC3", "ANARI_UFIXED16_VEC4",
                "ANARI_UFIXED32", "ANARI_UFIXED32_VEC2", "ANARI_UFIXED32_VEC3", "ANARI_UFIXED32_VEC4",
                "ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"],
            "tags" : [],
            "description" : "Backplate image"
        }, {
            "name" : "backplateFilter",
            "types" : ["ANARI_STRING"],
            "tags" : [],
            "default" : "nearest",
            "values" : ["nearest", "linear"],
            "description" : "backplate image filter mode"
        }
    ]
}
progschj commented 1 year ago

There is probably no reason to have separate parameters for backgroundColor and backplate instead just a single background parameter that is either ARRAY2D or FLOAT32_VEC4.