# Prefabs Overview

[View as Markdown](https://docs.banuba.com/far-sdk/effects/prefabs/overview.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%2Foverview.md%20\(Prefabs%20Overview\)%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%2Foverview.md%20\(Prefabs%20Overview\)%20and%20help%20me%20with%20it%20in%20my%20Banuba%20Face%20AR%20SDK%20project.)Install tools

A prefab is a high-level object that represents a set of rendering and SDK features.

Prefabs are divided into several types:

* [On Face](/far-sdk/effects/prefabs/face.md) - prefabs that depend on a face.
* [Makeup](/far-sdk/effects/prefabs/makeup.md) - prefabs that represent makeup features and also depend on a face.
* [Top Level](/far-sdk/effects/prefabs/top_level.md) - prefabs that affect the entire screen and are not attached to a face.
* [On Hands](/far-sdk/effects/prefabs/hands.md) - prefabs that apply effects to hands.
* [Sprites](/far-sdk/effects/prefabs/sprites.md#sprites) - prefabs that represent simple 2D sprites.
* [Sounds](/far-sdk/effects/prefabs/sounds.md) - prefabs that represent audio.

Example prefab configuration:

```
{

    "scene": "effect name",

    "version": "2.0.0",



    "camera": {},

    // Top level prefabs

    "background": {

        // ...

    },

    "foreground": {

        // ...

    },

    "lut": {

        // ...

    },

    "lights": {

        // ...

    },

    "msaa": {

        // ...

    },

    // On Face

    "faces": [

        {

            // first face

            "face_prefab1": {

                //...

            },

            "makeup_prefab1": {

                //...

            }

            // ...

        },

        {

            // second face

        }

        // ..

    ],

    // Sounds

    "sounds": [

        {

            "sound_prefab1": {

                //...

            },

            "sound_prefab2": {

                //...

            }

            // ...

        }

    ],

    // Sprites

    "sprites": [

        {

            "sprite_prefab1": {

                //...

            },

            "sprite_prefab2": {

                //...

            }

            // ...

        }

        // ...

    ]

}
```

Where:

* `scene` - the name of your effect.
* `version` - the version of this configuration file. Always set it to `2.0.0`. Earlier versions are intended for complex legacy effects.
* `camera` - indicates that the camera feed will be rendered on the screen.
* `faces` - an array of JSON objects describing the features to place on each face. For each face, define a JSON object whose keys are prefab names and whose values are the parameters for those prefabs.
* `top_level_prefab` - one of the top-level prefabs.
* `sprites` - an array of JSON objects describing sprite features.
* `sounds` - an array of JSON objects describing sound features.

tip

You can create an effect with any set of prefabs.

tip

You can change an effect at runtime by calling the `reload_config()` or `reloadConfig()` method:

* C++
* Java
* Swift
* JavaScript

```
constexpr auto new_config = R"(

    {

        "camera" : {},

            "background" : {

            // ...

        }

    }

)";

effect_player->effect_manager()->reload_config(new_config);
```

```
import com.banuba.sdk.player.Player



    // ...



    val newConfig =

        "" "

{

    "camera" : {},

               "background" : {

        // ...

    }

}

"" ";

    player.effectPlayer.effectManager()

        .reloadConfig(newConfig)
```

```
import BanubaEffectPlayer



// ...

let newConfig = """

{

  "camera": {},

  "background": {

      // ...

  }

}

""";

player.effectPlayer?.effectManager().reloadConfig(newConfig)
```

```
const new_config = 

`{

    "camera": {},

    "background": {

      // ...

    }

}`

player._effectManager.reloadConfig(new_config)
```

note

Colors are represented as three- or four-component strings. Each component is a value in the range *\[0, 1]* or *\[0, 255]*, and components are separated by spaces. For example, `1 0 0 1` represents red. HTML-style hex strings are also accepted. For example, `#00FF00` represents green; an alpha value of `FF` is assumed when omitted.
