Showing posts with label Video Tutorial. Show all posts
Showing posts with label Video Tutorial. Show all posts

Friday, November 6, 2009

2.49b Composite Nodes



Nodes are a powerful Blender feature, allowing you to change how your scene renders, to combine images and videos, and to do many types of special effects. Compositing is a critical part of the video production process. The purpose of this video is to make you comfortable moving around in the Node Editor and to introduce a some basic image effects.

Let's delete the default cube and have fun with Suzanne. So highlight the cube (right click), press X to delete and Enter to confirm. Then add Suzanne (space-add-mesh-monkey). Press F9 to go to the Edit buttons. Press the Set Smooth button to make her look a bit more presentable. Add a red material by pressing F5 (Shading), then the Add New button to add a new material. Set the R to 1, the G to 0, and the B to 0.

To set up node based rendering, press F10 to go to the Scene buttons. In the Anim panel, press the Do Composite button. When you do this, instead of the scene rendering, the result of your composite node processing renders when you press F12.



To go to the Node Editor, change the View type to Node Editor. Blender supports material nodes and texture nodes as well as composite nodes. To enable Composite Nodes, click the Face icon. Then, click on the Use Nodes button.



Two puzzling rectangular objects display. On the left is the Render Layers node. On the right is the Composite node. You can resize a node by clicking on the lower right part of the node and dragging. The nodes are connected by a black wire, from the yellow Image button on the right side of the Render Layer node to the yellow Image button on the left side of the Composite node. What's going on?

Composite nodes really have three types, Input, Output, and different types of things you might do to the input before you render the output. Think of compositing as similar to going to the barber shop. Your head, before you get your haircut, with unshaven and with unkempt hair, is the input. The barber can do a number of things - give you a shave, wash your hair, cut it short, and so on. These are like processing nodes. The end result - the output - ends up in the Composite Node. The first big rule of compositing is: There Can Only Be One Composite Node.

The Render Layers node is the input - your scene before anything is done with it. The Composite node is the result. Node setups can get very confusing. The easiest way to set them up is to place the input nodes (there can be more than one, because we might combine things, such as a scene with an image), on the far left, and the output node, the Composite node, to the right. The processing nodes are in the middle, best placed in logical order from left to right.

Move the Composite node all the way to the right. Moving is similar to moving in the 3D window. Press the Right arrow key to select the Composite node, then drag it all the way to the right. The wire follows along.



Press F12 to render. Suzanne renders as if there was no compositing active. You also see a thumbnail of the rendered scene both in the Render Layers node and the Composite node. That's because this is like walking into the barber shop, seeing the long line, and walking out. Nothing was done.

OK. Let's do some stuff to Suzanne. How about making her 3 times bigger? Easy. Instead of going back to the 3D view and scaling her up, you can do it in the Node editor. Add a Scale Node (Space - Add - Distort - Scale). Nothing happens yet. You need to connect the wires. To do this, connect the Image socket (that's the yellow Image dot) on the right side of the Render Layers node to the Image socket on the left side of the Scale node. This tells the Node editor to pump the scene, with Suzanne, into the Scale node. Set the X and Y values to 3, to indicate how large to scale Suzanne.

Next, connect the Image socket on the right side of the Scale node to the Image socket on the left side of the Composite node. This tells the Node editor to take the new, larger Suzanne, and add it as input to the Composite node. Look at the image on the Composite node. It already shows the bigger Suzanne. If you press F12 to render, Suzanne also renders larger.



That's a good start. How about flipping her upside down? Easy. Add a Flip node (Space - Add - Distort - Flip). Connect the Image socket on the right side of the Scale node to the Image socket on the left side of the Flip node. From the dropdown, select Flip X & Y. Now connect the Image socket on the right side of the Flip node with the Image socket on the left side of the Composite node.



The path is clear. Suzanne is scaled and then flipped. You can see each step. By the way, the 3D view hasn't changed. Suzanne is still her old self. Change to 3D view, look, and change back to the Node editor.

The Viewer node, another type of output node, lets you view Suzanne's progress. To add a Viewer node, press Space - Add - Output - Viewer. Automatically, the Viewer node is connected, via the Image socket, to the last node selected. A handy button is the Use Backdrop button, which displays the most recently selected Viewer node. You see Suzanne both scaled and flipped.



We can see Suzanne after she was scaled but before she was flipped. To do that, cut the connection between the Flip node and the Viewer node by pressing the left mouse button and dragging across the wire. Then, connect the output Image socket of the Scale node to the input Image socket of the Viewer node. Now Suzanne is scaled but unflipped.



Click the Backdrop button to get the regular background. Let's blur Suzanne, giving the illusion of fuzziness. Blur is a filter node. So press Space - Add - Filter - Blur. Connect the Image socket on the right side of the Flip node to the Image socket on the left side of the Blur node. Set X and Y to 10, specifying the blur amounts. Then connect the Image socket on the right side of the Blur node with the Composite node's image socket. Click the Backdrop button.



Now let's make Suzanne black and white. Add a Converter node to do that (Space - Add - Converter - RGB to BW). Convert the Image socket on the right of the Blur node to the Composite Node image socket.



Many of the keys you are familiar with in navigating the 3D window work in the node editor. Right click selects a node. Shift Right click on another node extends it. X deletes the selected nodes. Control-Z corrects your error.

You can group nodes when you have a lot of them. Let's say you really like to scale, flip, blur, and make objects black and white. You can create a group out of these nodes. Select all of them press Control-G. You've created a nice node group, cleaning up the diagram a lot. Node groups can be copied and even exported to another blend file, which is nice because you won't have to redo all those steps each time. The tab key shows the nodes in the group. If you change your mind, Alt-G undoes the grouping.



To summarize, we've enlarged Suzanne 3 times, flipped her over, blurred her, and got rid of her red color - all without touching the underlying 3D view, which you can see in the Render Layers node. This just scratches the surface. I hope this gives you a good start on compositing nodes in Blender. Happy Blendering!

Saturday, September 12, 2009

2.49a Color Picker



If you've used any imaging software such as Photoshop, you're probably familiar with selecting a color using the RGB sliders. Of course, you can do this in Blender as well. However, there is a feature called the Color Picker which gives you a number of other ways of choosing colors. Anywhere Blender asks you for a color, you can use the color picker.

We start by firing up Blender with its default scene. We're going to delete the default cube (right click to select, then X or the delete key to delete), and add a UV Sphere (Space - Add - Mesh - UVSphere). The standard way of selecting a color is to use the RGB sliders. We'll add a Material by selecting the UVSphere (Right Click) in Object Mode. To add a material, click the F5 (Shading) button, then the Materials button. Go to solid mode (press the Z key if you are in wireframe mode) so we can see the color. Then click the Add New button. To make the material red, drag the R slider all the way up to 1 and the G and B sliders all the way down to 0.

Another way to choose a color is by the combination of Hue, Saturation, and Value, or HSV. The color picker lets you do this either visually or by using the sliders in a similar fashion as RGB.

The rectangle to the left of the Col text has turned red to show the UVSphere's color. Left click on it to bring up the Color Picker.

Drag the little circle on the color picker swatch to change the hue. Dragging to the right increases the hue value from 0 to 1. Dragging to the left decreases the hue value from 1 to 0. As you drag, notice that the Hue settings, on the right, change as well.

There are two boxes, in the lower right part of the color picker. The lower box shows the old color. The box on top of it shows the new color. The color hasn't been applied yet. There are two ways to apply the color. You can drag the cursor out of the color picker box, or you can press Enter. In either case, the color is applied and the new color shows in the color rectangle.

Click on the color rectangle to bring up the color picker. You can also drag the little circle in the Saturation and Value square. The saturation ranges from 0 to 1 along the y axis, and the value ranges from 0 to 1 along the x axis. Note how the saturation and value sliders change as you move the circle. Drag the cursor out of the color picker into the 3D viewport to select the color.

Click on the color rectangle to bring up the color picker. There's another way to choose a color, by direct entry of a hexadecimal RGB value. Each RGB value can range from 0 to 255, which is 00 to FF in hexadecimal. Here's a cream color, for example, with a hexadecimal value of FFCC99. We can enter this value in the hexadecimal value area. Again, we drag the cursor out of the color picker into the 3D viewport to select the color.

Click on the color rectangle to bring up the color picker again. There are 16 presets which let you store custom colors in the color picker. You can select a color by clicking on one of the presets. Or, you can create your own preset, which Blender saves between sessions. That way, you can create your own palette. we'll create a color and then select a preset rectangle, then ctrl-left click to create our custom preset.

Finally, the Sample button lets you select a color from anywhere within your Blender screen. After you press the Sample button the cursor turns into an eyedropper. Move the eyedropper anywhere within Blender and then left click to select the color that way.

You can use the Sample button, combined with the Image Browser, to sample a color from an image on your hard drive. Split the screen (position the cursor on the border, then right click and select Split), choose the Image Browser. Navigate to the directory containing your images. Then go back into the Color Picker, click the Sample button, and sample an image from the thumbnails shown on the Image Browser.

Blender's color picker gives you a number of ways of choosing colors beyond using the RGB sliders. You can select from the hue swatches, from the Saturation and Value square, or enter the HSV values directly into the color picker. You can enter hexadecimal RGB value. Or you can sample a color by pressing the Sample button.