Binocular rivalry is an optical effect in which the brain alternates between interpreting the images from the left and right eye, rather than combining them into a single image. To create a binocular rivalry effect filter in Unity with an AR camera, you can follow these steps:
- Create a new Unity project and add an AR camera to the scene.
- Create a new material and apply it to a plane that is positioned in front of the camera. This material will be used to display the binocular rivalry effect.
- In the material, create two texture properties and assign a different texture to each one. These textures will be displayed alternately to create the binocular rivalry effect.
- Create a new script and attach it to the AR camera. In the script, create a public float field to control the duration of the binocular rivalry effect.
- In the update function of the script, use a timer to switch between the two textures at regular intervals, using the
material.SetTexturefunction. You can use the public float field to control the interval at which the textures are switched.
Last modified: March 3, 2023