RealityServer Features

Compositing

This is where you will actually create a final image, which is done using the composite_composite_components command. To use this command you must have previously prepared the composite you wish to use. The thing you need to setup for the command is the operation parameter.

The operation parameter is a map, the structure of which is based on the operation_template property returned when you originally rendered the components for the composite. To actually make changes you need to populate the operation with tints of simple colours, textured tints or both. Here is a quick example:

{
    "camera_attributes": {
        "mip_film_iso": {
            "type": "Float32",
            "value": 800
        }
    },
    "lights": {
        "overhead_light_inst": {
            "tint": { "r": 0.9, "g": 0.8, "b": 0.7 }
        }
    },
    "objects": {
        "fixed_area_grp_inst": {
            "glossy_reflection": {
                "direct": {
                    "tint": { "r": 0.2, "g": 0.3, "b": 0.3 }
                },
                "indirect": {
                    "tint": { "r": 0.2, "g": 0.3, "b": 0.3 }
                }
            }
        },
        "test_area_grp_inst": {
            "diffuse_reflection": {
                "direct": {
                    "texture": {
                        "name": "fancy_texture",
                        "scaling": { "x": 5.0, "y": 5.0, "z": 1.0 },
                        "rotation": { "x": 0.0, "y": 0.0, "z": 0.0 },
                        "translation": { "x": 0.0, "y": 0.0, "z": 0.0 }
                    },
                    "tint": { "r": 1.0, "g": 1.0, "b": 1.0 }
                },
                "indirect": {
                    "tint": { "r": 0.3, "g": 0.6, "b": 0.4 }
                }
            }
        }
    }
}

This is the object you would pass to the operation parameter to define the compositing operations to perform. For objects you can add tints and textures (one or both) which will multiply the component. If you provide both the texture is first tinted by the colour before being applied. While textured tinting of indirect components is not prevented, it will result in undefined behaviour and is not recommended. Same goes for textured tinting of lights.

You can also see in this operation we tint the light colour for one of the lights and also adjust one of the tone-mapping parameters. In the textured tinting you can also so there are options to control the texture lookup so you can adjust the tiling, rotation and translation of the texture. The name property of the textured tint refers to the db name of an element of type Texture. It is assumed you have already made this in the db. If you need to create a texture in the db from a file you can use the create_texture command.