- Home /
How do I use Movie Texture with alpha channel?
First time Unity user.
Is is possible to use a movie's alpha channel to control transparency of a texture? Or do I need to use a second grayscale movie that only contains the matte?
How CPU/GPU intensive are movie textures -- can many be played simultaneously? Anyone have any movie texture examples I could look at?
Does Unity 3 change/improve performance on how Quicktime movies as textures are handled?
Answer by Jaap Kreijkamp · Dec 16, 2009 at 02:12 AM
I believe Unity uses Theora as video format which doesn't support alpha channel. There was a qt plugin for unity, but believe it isn't really kept up-to-date and didn't work under windows and probably won't ever work for web-plugins.
It should be possible to make it work using a second movie that has luminance as alpha, of course, you first have to be able to extract the alpha channel in a second movie and second play the streams back perfectly in sync.
Answer by spencer lindsay · Dec 16, 2009 at 04:12 AM
Agreeing with Jaap.
Split the movie into an RGB version and an alpha version and then use them as seperate channels. We wrote an MOV material last month for this thing we're doing but I'm not sure we can give it away quite yet. Lemme check.
It would be cool to see if the two channel movie texture works on the web.
:s.
@spencer
Oh my! If you can give away the code for this .mov material you speak of, I would be sooo very excited. I'm currently trying to do the same.
If you can't give out the code, could you explain how the code works? $$anonymous$$aybe I'll whip up my own version.
Thanks!
-paul
Hi @Spencer lindsay would you please help me play the alpha channel video when the target found
Answer by MaDDoX · Jul 06, 2010 at 03:33 AM
Check this thread out, all you wanna know it's there, in detail:
http://answers.unity3d.com/questions/2263/movie-texture-blending
Answer by Dreamora · Dec 17, 2009 at 12:20 PM
.mov are converted to ogg theora videos which is the only video format that works natively in unity.
What you basically need is a shader, no code actually. The shader does nothing else than using the second movie texture as the alpha mask for the first movie texture.
If you stored luminance / brightness data in the second one to represent the alpha, then its just a matter of reading the color of the second and assign the g, r or b component to the a (alpha) component of the first texture.
That way movie texture 1 will use the R / G / B channel of movie texture 2 as its alpha channel.
As for the intensity: they are done fully decompressed in cpu as far as I'm aware. As such you should avoid having too large movies, especially nothing in the range of HD, if it shall run on normal machines too.
what type of shader should i use to put the 2 movies? and is there a way to use only one quicktime movie (exported with alpah from flash)?
@amit did you get it worked. i want to play an alpha channel video. help me