In an effect designed for a video call, you can change who can see a specific piece of content.
Visual elements can be set to display only for the current user, only for other participants or for everyone. This setting is reflected in each individual effect instance's video feed.
For example, you can display a card with text in the video feed that other participants see of you, but hide it in your own video feed.
This example project shows a basic implementation of the functionality covered in this article.
The user/participant visibility option can be set per-object.
Select the object that you want to change the visibility of in the scene hierarchy and scroll to the Enable For section in the Inspector Panel.
Use the User and Participants checkboxes to change who will see the object in their video feed. By default both boxes are selected, meaning the object is visible to everyone in the video call.
For testing, the dropdown at the top of the preview window allows you to toggle between the view that a user sees of themselves and the view that other partcipants see of the user.
When you're in a video call, your video feed is automatically mirrored horizontally when it's displayed to other participants on the call.
As such, it's important to account for any content that might be affected by this, either by mirroring specific assets or by mirroring the entire screen.
Mirroring a single object
If a single object needs to be flipped in other participants' video feeds, select the object and scroll to the Transformations section in the Properties panel. Set the Scale type to Per Axis and change the x axis scale to -1.
In the viewport the object will appear as though it is flipped the wrong way around, but in the Participants Preview (and in the live effect) the object will display correctly.
Mirroring your entire video feed
If your effect contains a large number of visual elements that would need to be flipped, it may be quicker and easier to mirror your entire video feed rather than adjusting the previous setting for each object.
However, we don't want to mirror our view in our own video feed, so some setup is required.
First, add a Null Object to the scene hierarchy to use as a container object and nest all of your effect's scene objects under it. We've named this object Card_null in the example project.
Add a second Null Object to the scene hierarchy, making sure that it's not nested within any other object. We've named this object MultiViewport_null.
Then, add a Canvas and two Rectangle objects and nest them within MultiViewport_null.
Rename one of the rectangles to self_rect to be used for your own view and the other to peer_rect for the participant view.
Select one of the rectangles and in the Properties panel, set its width and height to Fill Width and Fill Height, respectively. Repeat this step for the second rectangle.
Each rectangle should have a separate material assigned, with its Shader Type set to Flat.
Both materials should also have their respective textures linked to the Patch Editor. You can do this by clicking the arrow next to the material's Texture property.
Select the self_rect object and scroll to the Enable For section in the Inspector Panel. Make sure that User is selected and deselect Participants.
Do the opposite for the peer_rect object, enabling Participants but not User.
In the final step, we’ll need to use the Patch Editor to render the screen to both the self and peer textures, but mirror the feed sent to the peer texture.
Right-click the MultiViewport_null object in the hierarchy and select Create Patch. Do the same with the Card_null object.
These two patches form part of the patch graph shown below, which does the following:
With the above patch graph set up, the effect can be previewed from the user's and participants' points of view with the Preview Pane.