# Top Level Prefabs

[View as Markdown](https://docs.banuba.com/far-sdk/effects/prefabs/top_level.md)[![](/far-sdk/img/ai-guide/chatgpt.svg)Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.banuba.com%2Ffar-sdk%2Feffects%2Fprefabs%2Ftop_level.md%20\(Top%20Level%20Prefabs\)%20and%20help%20me%20with%20it%20in%20my%20Banuba%20Face%20AR%20SDK%20project.)[![](/far-sdk/img/ai-guide/claude.svg)Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.banuba.com%2Ffar-sdk%2Feffects%2Fprefabs%2Ftop_level.md%20\(Top%20Level%20Prefabs\)%20and%20help%20me%20with%20it%20in%20my%20Banuba%20Face%20AR%20SDK%20project.)Install tools

### Background[​](#background "Direct link to Background")

**Usage**

You can use a solid color:

```
{

    "background": {

        "color": "1 0 0 1"

    }

}
```

Alternatively, use a texture:

```
{

    "background": {

        "texture": "capy.jpeg",

        "rotation": 0,

        "scale": 1,

        "content_mode": "scale_to_fill",

        "blend_mode": "default",

        "clear_color": "1 0 0 1",

        "use_filter": true

    }

}
```

To blur the camera background:

```
{

    "background": {

        "blur": 0.5

    }

}
```

To make the background transparent:

```
{

    "background": {

        "transparency": 0.5

    }

}
```

Use this prefab to create a virtual background.

| Parameter             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                               Optional                               | Default Value |
| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------: | :-----------: |
| `color`               | Sets a solid background color. See the color-format note in the prefabs overview.                                                                                                                                                                                                                                                                                                                                                                                                                                                              | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |  `"0 0 0 0"`  |
| `transparency`        | Sets the background transparency to a value from 0 to 1.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `0.0`     |
| `texture`             | Sets an image or video file as the background texture. For best performance, use `.jpeg`, `.jpg`, `.png`, or `.mp4` (H.264 video with AAC audio). You can also use formats such as `.heic`, `.webp`, and `.webm`, but performance may vary by device. For more information, see the supported [image formats](https://docs.banuba.com/far-sdk/tutorials/capabilities/technical_specification#image-formats-support) and [video formats](https://docs.banuba.com/far-sdk/tutorials/capabilities/technical_specification#video-formats-support). | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `null`    |
| `rotation`            | Rotates the background texture clockwise in degrees.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `0.0`     |
| `scale`               | Scales the background texture.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `1.0`     |
| `content_mode`        | Fits the background texture within the frame. Possible values are `scale_to_fill`, `fill`, and `fit`.                                                                                                                                                                                                                                                                                                                                                                                                                                          | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |    `"fill"`   |
| `blend_mode`          | Sets the texture blending mode. Possible values are `default`, `screen`, `split_alpha`, and `multiply`. `default` uses traditional alpha blending; `split_alpha` expects the alpha channel on the right side of the input texture.                                                                                                                                                                                                                                                                                                             | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |  `"default"`  |
| `blur`                | Sets the background blur radius in the range `[0, 1]`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `0.0`     |
| `clear_color`         | Specifies the color of the area not covered by the background texture, such as when `content_mode` is `fit`. The default is black. The final alpha component is currently ignored; use `1`.                                                                                                                                                                                                                                                                                                                                                    | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |  `"0 0 0 1"`  |
| `camera_video_scale`  | \[Experimental] Sets the scale factor for the camera image relative to the center of the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |    `"1 1"`    |
| `camera_video_origin` | \[Experimental] Sets the offset of the camera image relative to the center of the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                       | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |    `"0 0"`    |
| `use_filter`          | Enables or disables a filter that smooths segmentation-mask contours.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `true`    |

**Preview**

![Right image compare](/far-sdk/assets/images/original_wide-2f360425a0e0a779832de176b75c4354.jpg)![Left image compare](/far-sdk/assets/images/background-470533cb99448493c845be22788ccd68.jpg)

Drag

### Foreground[​](#foreground "Direct link to Foreground")

**Usage** Apply a texture or a video to the whole screen.

```
{

    "foreground": {

        "filename": "path/to/texture/file",

        "@blend": "multiply",

        "rotation": 0,

        "content_mode": "scale_to_fill"

    }

}
```

| Parameter      | Description                                                                                                                                                                                                                                                                                                                                                                                                                       |                               Optional                               |   Default Value   |
| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------: | :---------------: |
| `filename`     | Path to a texture or video file. A texture must have a suitable alpha channel; otherwise, like a video, it hides the underlying content. For more information, see the supported [image formats](https://docs.banuba.com/far-sdk/tutorials/capabilities/technical_specification#image-formats-support) and [video formats](https://docs.banuba.com/far-sdk/tutorials/capabilities/technical_specification#video-formats-support). |                                  *+*                                 |        *+*        |
| `@blend`       | Applies the selected blending mode. The leading `@` in the parameter name is required. Possible values are `off`, `alpha`, `premul_alpha`, `alpha_rgba`, `screen`, `add`, `multiply`, `min`, and `max`.                                                                                                                                                                                                                           | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `"alpha"`     |
| `rotation`     | Rotates the foreground clockwise in degrees.                                                                                                                                                                                                                                                                                                                                                                                      | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |       `0.0`       |
| `content_mode` | Fits the foreground texture within the frame. Possible values are `scale_to_fill`, `fill`, and `fit`.                                                                                                                                                                                                                                                                                                                             | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") | `"scale_to_fill"` |

### LUT[​](#lut "Direct link to LUT")

**Usage** Apply a color filter, also known as a LUT.

```
{

    "lut": {

        "filename": "path/to/lut/file",

        "strength": 0.9

    }

}
```

| Parameter  | Description                         |                               Optional                               | Default Value |
| :--------- | :---------------------------------- | :------------------------------------------------------------------: | :-----------: |
| `filename` | Path to the LUT file (usually PNG). |                                  *+*                                 |      *+*      |
| `strength` | LUT strength in the range `[0, 1]`. | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `1.0`     |

**Preview**

![Right image compare](/far-sdk/assets/images/original_wide-2f360425a0e0a779832de176b75c4354.jpg)![Left image compare](/far-sdk/assets/images/lut-d90746e32baa84b6f5b8027228b9f563.jpg)

Drag

### Lights[​](#lights "Direct link to Lights")

**Usage** Add up to four directional light sources to GLTF models in addition to IBL textures. A GLTF model is required.

```
{

    "lights": {

        "radiance": [

            "10 0 0 0",

            "0 0 10 0"

        ],

        "direction": [

            "-1 0 0",

            "1 0 0"

        ]

    }

}
```

| Parameter   | Description                                                                                                                                                        |                               Optional                               |                  Default Value                 |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------: | :--------------------------------------------: |
| `radiance`  | An array of light-source radiance values, or a single value for one light. Each value contains *R*, *G*, and *B* components followed by a light wraparound factor. | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") | `["0 0 0 0", "0 0 0 0", "0 0 0 0", "0 0 0 0"]` |
| `direction` | An array of light-source directions, or a single direction for one light. Each direction contains *X*, *Y*, and *Z* components.                                    | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |     `["0 0 0", "0 0 0", "0 0 0", "0 0 0"]`     |

### MSAA[​](#msaa "Direct link to MSAA")

**Usage** Apply multisample anti-aliasing to the effect. MSAA makes the image look cleaner by smoothing jagged edges. A GLTF model is required. The `@samples_count` parameter is required.

```
{

    "msaa": {

        "@samples_count": 4

    }

}
```

| Parameter        | Description                                                                                   | Optional | Default Value |
| :--------------- | :-------------------------------------------------------------------------------------------- | :------: | :-----------: |
| `@samples_count` | Required MSAA sample count. The value must be `1`, `2`, or `4`. A value of `1` disables MSAA. |    *+*   |      *+*      |

### Bokeh[​](#bokeh "Direct link to Bokeh")

**Usage** Enable the bokeh effect for the background.

```
{

    "bokeh": {

        "samples": 16

    }

}
```

| Parameter | Description                                                                         |                               Optional                               | Default Value |
| :-------- | :---------------------------------------------------------------------------------- | :------------------------------------------------------------------: | :-----------: |
| `samples` | Sample count in the range `[8, 24]`. Higher values produce a stronger bokeh effect. | ![\`${props.title} icon\`](/far-sdk/img/icons/check.svg "Supported") |      `16`     |

**Preview**

![Right image compare](/far-sdk/assets/images/bokeh1-d7e98efa92c812542789f664a113638d.jpg)![Left image compare](/far-sdk/assets/images/bokeh2-7a57a4a3469764e1337ab4dc0f704eba.jpg)

Drag
