Overview
AB Switch is a tool that features texture transitions mapped onto a 3D object, for example, a virtual screen in scenes in which transitions occur. It behaves similarly to a standard A/B (or Program/Preview) transition effect in a switcher/vision mixer.
Setup
Create an AB switch
There are two ways to create an AB Switch: from the Details panel, or from a blueprint.
Add the AB Switch component to the actor of your choice by using the Add Component button.
From the Details panel:
From a blueprint:
Note: all the AB Switch will show up in the config panel (components and the AB Switch Actor).
Spawn the actor from the config panel:
Go to the PRIME VSAR Config panel.
Choose the AB Switch category under Tools and click Spawn AB Switch Actor.
Click the newly created AB Switch icon.
Create a render target
In order to assign the AB Switch to an object, you must create the Render Target and the Material and assign it to your object(s).
1. Click Create Render Target & Material.
2. Two Save Prompts display, one to save the Render Target, the other to save the Material.
- Here we created an ABSwitch folder to save these assets.
3. Drag and drop the Material Instance onto one or multiple objects.
- The object will become transparent, because no source is open/loaded.
AB Switch: Source
You can preview the effects from the AB Switch Source area.
Multiple source types can be used:
- URL
- File Path (Path)
- Media Source
URL are formatted as follows:
- Files (video, images): File://C:\Users\User\Clips\2019-03-05_13-07-24.mp4
- External input: hal://input0_0
Loop video
Loop Video: The source loops forever after it has been opened. Normal behavior is that after the source is opened it plays from start to finish and then it is closed, enabling loop video prevents this.
“Open Program/Preview” opens the source.
Important: Open Program/Preview is for preview purposes only, do not use in production. Use open function instead
Note: AB Switch supports sources with alpha channel (color channel), making the material transparent when the source alpha is at 0 value.
To preview the transition:
Click Start Transition.
Note: The third channel source is the “Transition” channel.
It’s used for effects that are using a third source to do the transition (more details in the AB Switch - Effect).
AB Switch: Effects
You can select your transition effects option under the AB Switch - Effect area.
- Transition Effect: The selected effect.
- Effect Parameters: Each effect parameters are automatically generated from exposed parameters in the effect material.
- Value: The value of the effect. Range: 0 - 1. 0 is no effect, 1 is the full effect, 0.5 is half effect.
- This value can be changed for testing, but it will be overwritten by the AB Switch when a transition is happening
- Note: Some effects have whole number (i.e., no decimal) requirements, you can hover your mouse to view a description of the values.
- Effect List: Currently implemented effect in the list. Available effects (name and individual properties) are as follows:
- Fade
- Disc
- Push
- Wipe
- Alpha Transition
- Video Transition
- Alpha Transition: Allows the use of Alpha Channel (color channel) value as the transition value taken from the “Transition” Source Channel.
- Video Transition: Video Transition allows you to use the video set in the “Transition” Source Channel, in order to do a “hover” transition.
Note: ⚠️ Images are not supported as “Transition” Source Channel for Alpha/Video Transition |
- Duration: The time it takes the Alpha/Video Transition to to play from start to finish.
- Prevent New Transition: Prevents another transition to start before the current one is finished
- Use Duration for Transition Videos: Instead of using the length of the video for the transition the Duration parameter is used.
- Close Transition When Transition Finished: Should the transition player immediately be closed when transition is finished (only valid when “Use Duration for Transition Videos” is enabled)
Custom Effects
Effects are a material-based structure, so we will need two things to create a custom effect:
- Material
- AB Switch Effect Structure (that can be added through the content browser Add/Import → PRIME VSAR → AB Switch effect)
When opening the newly create AB Switch Effect we can see:
- Name - the name that will be visible in the Transition dropdown
- Material - material used for the transition
- Use Transition Player - this is when we want to use the “Transition” Source Channel inside the material
Material used for AB Switch Effect is expected to be post process domain, the blend mode to be alpha composite (this can be set after Output Alpha is enabled), the shading model to be Unlit and Output Alpha enabled:
Material gets provided two Textures Parameters and Value Parameter (with specific names that have to match):
When using the Use Transition Player, the Transition texture parameter becomes available to the material:
All Textures Parameter needs to have their sampler type set to be external:
Value Parameter is used by the AB Switch to drive the transition, When using Use Transition Player, Transition Texture Parameter is used instead (of Value Parameter) to drive transition.
To use your material:
- Assign it to the AB Switch effect in the material section.
- Assign AB Switch effect to the Selected effect in the AB Switch.