'Transparent video in Android AR Scene

I am looking to solve the problem of displaying a transparent video in the AR scenes using Unity ARFoundation and Android platform.

I mean, accurately with a simple effect presented for the iOS platform: https://www.youtube.com/watch?v=vralbqaeqrk

In the normal 3D application I use the transcoded .Webm file and I achieve the intended purpose. Using the same solution in the AR (ARCore) scene the background color is visible.

Can you use specialized/dedicated assets? Or should I stop dreaming about such a result using Unity and Android?



Solution 1:[1]

You need to make sure that your video clip does have an alpha channel then just click keep alpha property in video importing section and hit apply. However it will only show if your video does have an alpha.

Video import settings

Then just attach a Video player component to the gameobject which has a Mesh renderer.

Video player on Cube

Make sure the Render mode is Material override and Material property tells unity on which map of the material video output will be displayed.

If you want to play it on UI, just make a render texture and assign it to RawImage and assign the Video player with following settings.

Video player on Raw image

Lastly make sure the render texture you created does have support for alpha.

Render texture

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Digvijaysinh Gohil