Log in or register to post comments

How to play a video with alpha channel in the VideoSample demo project

October 25, 2013 - 9:49pm #1

Hi all,

How to play on a marker a video with alpha channel transpacency with Unity 3 Extension?

I found this:

http://www.youtube.com/watch?v=NNt-kw0wig0

but I don't know how.

Thanks.

How to play a video with alpha channel in the VideoSample demo project

August 27, 2017 - 7:25am #9

Jove... 

I am beginner ... you could modify the code. Send it to

Thank you

How to play a video with alpha channel in the VideoSample demo p

October 30, 2013 - 9:10am #8

Thanks AlessandroB, but I‘m newbie using unity, can anyone show some code about it, or some demo project with VideoSample.

Thanks!!!

How to play a video with alpha channel in the VideoSample demo p

October 29, 2013 - 5:56am #7

k, here are some hints:

the VideoPlayback sample has a "video" object to which a VideoPlaybackBehaviour component (script) is attached;

this script is responsible for handling the video texture (see mVideoTexture and mKeyframeTexture variables); there is nothing special about it, except the fact that the renderer.material.mainTextureScale = new Vector2(1, -1);

This is used for flipping the texture vertically, as the video texture is generated from the video in native code and is "upside-down".

Then you need to replace the existing shader which is applied to the video object, with your custom shader; your custom shader will need to work with texture coordinates in the range [0,1], both for vertical and horizontal (UV); the mainTextureScale may be the culprit of why you are not seeing the video when you use your custom shader, so you may need to adapt the shader to use the vertically flipped UV coords.

How to play a video with alpha channel in the VideoSample demo p

October 29, 2013 - 12:50am #6

I made my project in unity. and it works with shaders. but when i tried to use with vuforia it doesnt work. Video just disappeared. I googled and iam here.

How to play a video with alpha channel in the VideoSample demo p

October 28, 2013 - 3:55am #5

I understand that you want to integrate it in a Vuforia sample, but what I'm suggesting is that the alpha video effect "per se" is something Unity-related, as Vuforia does not have specific API to handle that (and also, it should not prevent you in anyway from achieving it)...

 

How to play a video with alpha channel in the VideoSample demo p

October 28, 2013 - 3:52am #4

How to play a video with alpha channel in the VideoSample demo p

October 28, 2013 - 1:56am #3

I think this question relates more to Unity programming than to Vuforia; I guess this is not the right Forum where to post it...

 

How to play a video with alpha channel in the VideoSample demo p

October 27, 2013 - 5:56pm #2

Anyone help?

Log in or register to post comments