For blender noobs: green screen using nodes!!!

In a world of green screen technology, I just though I would be useful and show everyone how to make a green screen using nodes.:smiley: Notice, this method is used for layering a live shot green screen video on top of another. i just really don’t have time or money to set up a green screen.some images would take up too much space on a page so just click on them.:slight_smile: Don’t delete the default cube or anything when you open up blender, as we will use it for our green screen image. the background color in the 3d render is automatically transparent, but as you will see later, if you do the tut properly, green objects will not show up in the render which obviously means they would not show up in a live video. First, click “set composite” in the render buttons in the buttons editor:
http://img212.imageshack.us/img212/9149/aughhhvq2.png
Press “0” in the 3d view to go into the camera. Now, right click on the line separating the buttons window and the 3d window. Choose “split area” and click where preferred to split the area:). It should preferably end up looking like this:
http://img520.imageshack.us/my.php?image=firstoneia0.png
now click on the right window for the node editor:
http://img68.imageshack.us/my.php?image=2ndonefw7.png
at the bottom of the panel there is an image of a face. click on it:
http://img520.imageshack.us/img520/1961/3rdonerh8.png
now click the button that says “use nodes” and it should end up looking like this:
http://img68.imageshack.us/img68/9878/5thoneqq8.png
also, draw a box where it shows in the image to delete the connection. Press space now to open up a menu and do “add” then “input” then “image”
http://img186.imageshack.us/img186/1463/6thoneib1.png
I am going to select a video, because images can be still and boring in a green screen movie. It ends up looking like this:
http://img68.imageshack.us/img68/5969/7thonefa1.png
now click on the picture of a face and select “movie”
http://img520.imageshack.us/img520/5449/8thoneub2.png
It’s only going to display the first frame of the movie, so you should figure the number of frames in your movie. go to the “node editor” and input that number of frames where it shows in the picture:
http://img520.imageshack.us/img520/5342/13thonety0.png
Now press “space” to open up the menu, then do “add” then “matte” then “channel key.” It should end up looking somewhat like this:
http://img186.imageshack.us/img186/7094/14thonegx4.png
notice that the setting “G” (for green) is enabled. set the “High” and “Low” setting all the way up and attatch the yellow image dot to the output as you see below. Right now you wont see anything amazing, but the fun is about to start:D.
http://img399.imageshack.us/img399/5104/15thonegc9.png
Right click the default cube, and go to the “material” settings. click “add new” to add a new material to the cube.
http://img399.imageshack.us/img399/3163/16thonepd0.png
change the material color to green and press F12 to render the image. It doesn’t seem to be amazing at all, but close the render window, and you can see that in the “nodes” window, the GREEN cube is transparent.
http://img399.imageshack.us/img399/7383/17thoneoe7.png
press the arrow at the top left of the “channel key” box to compact it down. This just saves space as you will not need to use it anymore.
http://img212.imageshack.us/img212/3135/18thonepr8.png
Press “space” yet again to open up the menu. Go “add” then “color” then “alpha over”
http://img212.imageshack.us/img212/6928/19thonepv3.png
It would probably look like this. If it doesn’t, connect everything to look like this:
http://img117.imageshack.us/img117/5154/20thoneak5.png
now hopefully, you haven’t forgotten about the video at the top left. If you did, that’s just too bad:). But for all of those who did not, connect your nodes to look like this:
http://img212.imageshack.us/img212/9430/21stoneuk8.png
now press F12 to render. It should look somewhat like this:
http://img212.imageshack.us/img212/4545/22ndonewk0.jpg
not really what you expected, but wait, go to the 3d view, add a normal cube, and press “g” to move it to another part of your camera’s view range. it should now look like this:
http://img212.imageshack.us/img212/6323/23rdonelz9.jpg
Unfortunately, there is a blue silhouette around each image. this would not show up in a live shot green screen movie. However, if you want to take it away, go the the “alpha over” in the node editor, press the “convert premul” button, and put the “premul” factor all the way up:
http://img212.imageshack.us/img212/1791/25thoneur5.png
now go to the “world” buttons in the “material” buttons and set the background to be white:
http://img399.imageshack.us/img399/7938/26thonest5.png
Render the image again and you will have gotten rid of most of that annoying blue silhouette.
http://img399.imageshack.us/img399/3217/27thonefc2.jpg
NOW, FOR ALL OF YOU PEOPLE WHO HAVEN’T READ THE TOP PART OF MY TUT, GREEN OBJECTS DO NOT SHOW UP IN THE RENDER WITH THIS NODE SETUP. Also, green objects are very useful for hiding other objects behind:
http://img399.imageshack.us/img399/2876/28thoneml7.jpg
unfortunately, there is a tiny trace of white in the image. to get rid of all the white, go to the render buttons (F10) and enable “premul”
http://img242.imageshack.us/img242/3656/premullr1.jpg
use this method for layering a green screen video on top of another video. However, considering green screen live videos usually don’t have perfect green you may need to edit out a few annoying black specks. to do this, do “add”, “matte” then “luminance key” and attach it to the channel key. play around with it and all black specks will be erased:
http://img165.imageshack.us/my.php?image=greenscreennospeckxo0.png
Congrats, you have successfully made a green screen using nodes. If you know how to animate, then this is an easy way of making a video.

by the by, if I overlooked something in this tutorial, or if you have a problem with it, don’t hesitate to tell me.

could someone tell me if this tut is useful?

I tried the tutorial. Waaay too complicated :stuck_out_tongue: also, nothing shows up- its just eyeballs …and grainy ones at that :slight_smile:
blender’s channel key isn’t all that great - I’d personally go for the chroma key or luma key if I were doing it this way, but its WAAAAY simpler than you make it out to be!

just use a mix node with the alpha (A) on and the factorial as the alpha channel and you’re good to go! - see node setup / results in the pictures below (the good one is using a mix node :D)

so yeah, Blender already has masks built in to the alpha channel.
and you can always dialate/ erode / blur the alpha channel to get a proper mask.

so, try a “screen” or a “mix” and you should get the proper effect without a mask to worry about :slight_smile:

Attachments




Warning dont screw around in that unless you know what your doing lol!

When you do a green screening tutorial you should probably use live-action footage. Doing green screening on 3D images is pretty useless because you can render with alpha channels. I understand that for the example scene its easier to use a quick basic scene with some green in it. The green color you get with live action footage is rarely “pure” green and it will require more work to get a good key.

Thanks for the corrections guys. I know the tut seems more complicated than it is, and that is because I like to clarify everything, because sometimes when I read a tut, I have to figure out almost everything on my own. I did overdo some parts, and I am editing those out. AMDBCG, I did not clarify this very well, but the tut is supposed to be about layering 1 live shot green screen video on top of another. I just don’t have any money or time to make a green screen. thats why green objects don’t show up. “Mix” key is good, but that is only for layering a renderlayer on top of an image. thanks anyways. MadMesh, thanks a lot. I’m working on some way to fix it now.

It worked perfectly for me! Thank you!

Great tutorial, bojo600! I just took a few moments to read it and I realized that it is almost the same process as what I was doing a few days ago, which was a success :). Thanks a lot!

Thanks for the tutorial!

thanks guys, (yay, people used my tutorial :slight_smile: )