2

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?

Artik
  • 803
  • 14
  • 36

1 Answers1

2

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

Digvijaysinh Gohil
  • 1,367
  • 2
  • 15
  • 30
  • Thak you. Yes, it works (I did it my tests) in ordinary 3D scene but it dosen't in AR scele. – Artik Mar 26 '22 at 20:55
  • In your ar scene, after following the above steps, are you able to see transparent video in the play mode inside unity editor? If not then I need more information on how you have setup your ar scene? – Digvijaysinh Gohil Mar 28 '22 at 16:12