You can define different configurations for your scene and switch between configurations at runtime using the "UVR Variants" components. The variants are components that list a set of options for an element in the scene, the available variants are :
UVR Material Variants : to change the materials of a Mesh Renderer,
UVR Skybox Variants : to change the skybox of a Camera,
UVR Geometry Variants : to change the mesh of a Mesh Filter,
UVR IES Variants : to change the IES file of an Area light with a Photometric EDF,
UVR Display Variants : to change the directory holding the measure of an Area light with a Measured Display EDF,
UVR Transform Variants : to change the transform of a GameObject,
UVR Spinner Transform Variants : to rotate a transform around a pivot,
UVR Setup Variants : to activate/deactivate groups of GameObjects in the scene,
From patch 1.7.57 on, two additional variants are available :
UVR Layer Variants : to activate/deactivate GameObjects in the scene depending on their layer,
UVR Tag Variants : to activate/deactivate GameObjects in the scene depending on their tag,
The UVR Variants components can be instantiated/added in the scene via the “GameObject/PredictSuite/Scenarization” menu.
Apart from the materials or the camera transform that can be edited interactively, the Predict Engine scene must be reloaded every time the Unity scene is edited by script, manually or using a variant. The reloading of the Predictive Engine scene is automatically performed if the "Auto Reload" option is enabled in the preferences, or by the variant manager when you pick a new option.
Variants are the main tool to define configurations for the Batch Renderer. See the Outputs section for more details.
The Skybox Variants is a Beta version and is only supported in the Legacy version of Unity, for RGB environment defined in a Skybox component only. The Variants cannot be defined in HDRP, and they cannot be defined for complex UVR Spectral environment.
There are two types of variants :
Settings variants (Material, Skybox, Geometry, IES, Display, Transform, Spinner Transform) affect the GameObject they are placed on and modify their intrinsic settings. The component must be added to the GameObject that should be modified : the light for the IES and Display Variants, the geometry for the Geometry and Material Variants, the camera for the Skybox Variants. The Material Variants can also be added to a GameObject that is the parent of a group of geometries. In that case, the Concerned Meshes and the Selected Submesh fields of the picker enable you to choose which renderers and sub meshes should be affected by the variants. See example 1 bellow.
Example 1 : consider a Material Variants placed on the "Spheres" GameObject.
Concerned Meshes = "This Game Object" : the Material Variants will affect the "Spheres" GameObject only,
Concerned Meshes = "This Game Object And All Childs" : the Material Variants will affect the "Spheres" GameObject and all three child GameObjects,
Concerned Meshes = "Childs Only" : the Material Variants will affect the three child GameObjects but it will not affect the "Spheres" GameObject.
Group variants (Setup, Layer, Tag) activate and deactivate groups of elements in the scene. They can be placed anywhere in the scene. They have an additional setting called "Affected Element" that defines what part of the GameObject should be enabled/disabled (see example 2 bellow), the options are :
GameObject (disable the entire GameObject, blue square on the image : this affects the children),
Light (disable the Light component, yellow square on the image),
Mesh Renderer (disable the MeshRenderer component, red square on the image),
All Components (disable the Light, and the MeshRenderer : this does not affect the children)}.
The camera environment (Skybox, solid color, UVR settings) is also affected by a group variant that affects the "Light". In this case, the "Camera" component is enabled/disabled by the variant instead of the "Light" component. Disabling a camera (or physical sensor) component only affect the loading of the environment.
The Setup Variants affect the listed GameObjects AND their childs. That is to be able to affect a subgroup of a Hierarchy. To select individual GameObjects, use a Layer Variants or a Tag Variants.
The Layer Variants and Tag Variants only affect the listed GameObjects, NOT their child. That is to have more freedom on the selection. You can manually add a GameObject's children to a Layer or a Tag if necessary.
See example 2 bellow.
Example 2 : consider the following Hierarchy and variants (the variants are placed on separate objects).
The Setup Variants affects the "Mesh Renderer" of the selected GameObjects AND their children.
Option 0 : the variant enables the Cube and the Sphere MeshRenderer components,
Option 1 : the variant enables the Capsule MeshRenderer component,
Option 2 : the ParentCylinder doesn't have any MeshRenderer, the variant enables the Cylinder MeshRenderer component.
The Layer Variants affect the "Light" of the GameObjects with the selected layer, NOT their children. Suppose the Cube is on "LightGroup1" and the Capsule is on "LightGroup2".
Option 0 : the Cube doesn't have any light, the variant doesn't affect its children, nothing happens
Option 1 : the variant enables the Capsule Light component.
The Tag Variants affect the "Game Object" with the selected tag, NOT their children. However, disabling an entire GameObject in Unity also affect its children. This is the only case where a Tag Variant or a Layer Variant will affect the childs. To disable fully an element without affecting its children, select "Affected Element = All Components" : this will disable the GameObject's component, not the GameObject itself. SUppose the Cube has "Tag1" and the Capsule has "Tag2".
Option 0 : the variants enables the Cube, this indirectly affects the visibility of the Sphere,
Option 1 : the variants enables the Capsule,
Option 2 : no tag is selected > the variants only disables all other options.
There should never be any static geometries in a setup used in a Setup Variants, Layer Variants, Tag Variants or a Geometry Variants.
Every Variants component has an Interface section with the default variant settings :
The Key To Switch Option is a keyboard shortcut to switch between the different options when using the engine overlay,
The Initialize On Awake field defines whether the first option should be assigned when the application is started,
The Load Options from command line field defines whether assets dropped on the application *.exe file should be included in the variant options. This option has no effect in the Unity Editor environment, it is only active once the application has been deployed. The supported assets are :
textures for the RGB Environment Variants,
directories for the Display EDF Variants (main directory holding the "red", "green" and "blue" directories),
*.ies files for the IES Variants,
*.xml material files for the Material Variants(materials in the OMEN format),
directories holding any of the previous assets.
Two buttons on the bottom ("<" and ">") enable you to switch between the selected options. Caution : using these buttons, the current state of the GameObject will not be saved and will be overridden.
From patch 1.7.56 on, Variants also have a Light Groups section to identify the Variants that represent a Light Group. This is only useful when using the Batch Renderer.
Light Groups are useful when you have different light sources in your scene that :
you want to control individually in post process, to be able to adapt their intensity for instance,
you want to render separately because they don't need the same rendering time.
Frames generated from a Variant that represents a light group can then be composited into one final result. See the Batch Renderer section for more details.
Each Variants component contains a field to define the list of possible options : materials, setups, ies files, directories, geometries, environments.
The Transform Variants also contains an "Add Variant" button. This button creates a new variant with the current GameObject's Transform.
For the Transform and Spinner Transform Variants, the currently selected option is displayed above the "Add Variant" button.
The Variant Manager window contains a list of all Variants components in the scene. It enables you to edit them, copy or delete them, create new ones, and enable/disable them.
The window can be found under the menu "PredictSuite/Variant Manager".
The left part of the window contains a list of all the Variants component in the scene, grouped by category :
Variants that are placed on an enabled GameObject can be enabled/disabled using the toggle on the left,
Variants can be edited by clicking on their name or one the arrow on the right. The selected component can be edited on the right part of the window,
Variants can be deleted using the "-" button,
Variants can be duplicated using the "+" button : a "Select GameObject" window appears to choose on which GameObject the new component should be placed.
For each category, the "+" button next to the category name enables you to create a new Variants component of this type : a "Select GameObject" window appears to choose on which GameObject the component should be placed.
You can use variants to define scene configurations and render them using the Batch Renderer window. The button on the top right corner of the window enables you to switch easily between the variant manager and the batch renderer.