<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blender Guru &#187; composition</title>
	<atom:link href="http://www.blenderguru.com/tag/composition/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blenderguru.com</link>
	<description>Quality tutorials, tips and articles</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:45:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Creating Depth of Field</title>
		<link>http://www.blenderguru.com/creating-depth-of-field/</link>
		<comments>http://www.blenderguru.com/creating-depth-of-field/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 18:55:59 +0000</pubDate>
		<dc:creator>Andrew Price</dc:creator>
				<category><![CDATA[Compositing]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[composition]]></category>

		<guid isPermaLink="false">http://www.blenderguru.com/?p=715</guid>
		<description><![CDATA[When used correctly Depth of Field can draw attention to the subject and make the scene more aesthetically pleasing. When used incorrectly, it can be seen as another overused tiresome effect. Learn the difference and how to correct it.]]></description>
			<content:encoded><![CDATA[<p>Even though we&#8217;re creating digital renders in a 3d world, we need to keep in mind that we are still imitating a real world camera lens. Cameras and human eyes have something called &#8216;<a href="http://en.wikipedia.org/wiki/Depth_of_field" target="_blank">Depth of Field</a>&#8216; (or &#8216;DoF&#8217;), which makes objects in the background and foreground appear blurry.</p>
<p><span id="more-715"></span>When used correctly in your artwork, it can draw the attention to the subject and make the scene more aesthetically pleasing. When used wrong, it can seem like another overused tiresome effect. Learn the difference and how to use it effectively.</p>
<p><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/explode4c.png"><img class="aligncenter size-medium wp-image-756" title="Exploding Lightbulbs" src="http://www.blenderguru.com/wp-content/uploads/2009/11/explode4c-540x253.png" alt="Exploding Lightbulbs" width="540" height="253" /></a></p>
<p>To play along at home, download <a href="http://www.blenderguru.com/wp-content/uploads/2009/11/starter-scene.blend">this light bulb scene</a>.</p>
<p style="text-align: center;"><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/starter-scene.blend"><img class="aligncenter size-medium wp-image-754" title="wire-scene" src="http://www.blenderguru.com/wp-content/uploads/2009/11/wire-scene-540x252.jpg" alt="wire-scene" width="540" height="252" /></a></p>
<p style="text-align: left;">The final .blend will be provided at the end of the tutorial.</p>
<p style="text-align: left;">Let&#8217;s get cracking!</p>
<p style="text-align: left;"><!--more--></p>
<h3>Step 1</h3>
<p>Open the file and select the camera and press the &#8216;Show Limits&#8217; button in the edit panel. You will notice that a yellow cross hair appears at the base of your camera.</p>
<p><img class="aligncenter size-full wp-image-720" title="camera-limits1" src="http://www.blenderguru.com/wp-content/uploads/2009/11/camera-limits1.jpg" alt="camera-limits1" width="540" height="460" /></p>
<p>This is the point that blender will focus on. You can change the position of the cross hair two ways: by changing the DoF Distance value. Or by typing in the name of an object for the camera to focus on. The latter is very useful for animations where you want to change what the camera focuses on in the middle of the animation. I used this technique extensively in my film &#8216;<a href="http://www.blenderguru.com/the-ballad-of-the-m4-carbine/">The Ballad of the M4 Carbine</a>&#8216;, where I made the camera focus on a moving empty that changed moved mid animation.</p>
<p>However because this is only a still we can use the first method.</p>
<h3>Step 2</h3>
<p>So by clicking the next arrow, make the yellow cross hair sit in line with the exploding light bulb.</p>
<p><img class="aligncenter size-full wp-image-755" title="camera-dof-dist2" src="http://www.blenderguru.com/wp-content/uploads/2009/11/camera-dof-dist2.jpg" alt="camera-dof-dist2" width="540" height="376" /></p>
<p>With the camera now setup to render, we can move onto the compositor.</p>
<h3>Step 3</h3>
<p>Switch to the Node Editor by selecting it from the Window Type popup list.<br />
<img class="aligncenter size-full wp-image-721" title="node-editor" src="http://www.blenderguru.com/wp-content/uploads/2009/11/node-editor.jpg" alt="node-editor" width="540" height="392" /></p>
<h3>Step 4</h3>
<p>Select the <em>compositor icon</em> and the <em>Use Nodes</em> button.</p>
<p><img class="aligncenter size-full wp-image-723" title="node-editor1" src="http://www.blenderguru.com/wp-content/uploads/2009/11/node-editor1.jpg" alt="node-editor1" width="540" height="260" /></p>
<h3>Step 5</h3>
<p>Go ahead and disconnect the &#8216;Render Layer&#8217; from the Composition node.</p>
<p><img class="aligncenter size-full wp-image-724" title="disconnect-nodes" src="http://www.blenderguru.com/wp-content/uploads/2009/11/disconnect-nodes.jpg" alt="disconnect-nodes" width="540" height="260" /></p>
<h3>Step 6</h3>
<p>Hit the space bar and add a <a href="http://wiki.blender.org/index.php/Doc:Manual/Composite_Nodes/Types/Filter#Defocus" target="_blank">Defocus Node</a> (Add&gt;Filter&gt;Defocus) and connect to the render layer and composite layer as shown in red here.</p>
<p><img class="aligncenter size-full wp-image-726" title="defocus1" src="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus1.jpg" alt="defocus1" width="540" height="373" /></p>
<h3>Step 7</h3>
<p>We want the node to use the data from the cameras Z-depth, so connect the <em>Z input</em> to the render layers <em>Z Output</em>.</p>
<p><img class="aligncenter size-full wp-image-727" title="defocus-zdepth" src="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus-zdepth.jpg" alt="defocus-zdepth" width="540" height="373" /></p>
<h3>Step 8</h3>
<p>Go ahead and turn off the <em>No zbuffer</em> and <em>Preview</em> buttons. They are rarely used and seem to exist only so we can turn them off.</p>
<p><img class="aligncenter size-full wp-image-728" title="no-preview-zbuffer" src="http://www.blenderguru.com/wp-content/uploads/2009/11/no-preview-zbuffer.jpg" alt="no-preview-zbuffer" width="540" height="373" /></p>
<p>Now onto the important part: the fStop value.</p>
<p><img class="aligncenter size-full wp-image-739" title="fstop-point" src="http://www.blenderguru.com/wp-content/uploads/2009/11/fstop-point.jpg" alt="fstop-point" width="540" height="372" /></p>
<p>Without getting too technical, the <a href="http://en.wikipedia.org/wiki/F_stop">fStop</a> value defines how much on either side of the yellow cross hair to make in focus. The smaller you make the fStop value the less of your scene will be in focus. Many artists get carried away by how cool DoF looks, and make this value unnecessarily small. This in turn makes everything appear miniature.</p>
<div id="attachment_730" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.flickr.com/photos/anacoboy/1843178722/"><img class="size-full wp-image-730" title="ant" src="http://www.blenderguru.com/wp-content/uploads/2009/11/ant.jpg" alt="Much like this cheerio." width="500" height="329" /></a><p class="wp-caption-text">Like this guy.</p></div>
<p>For an example of how DoF can affect your perception of size, watch this <a href="http://vimeo.com/4815813">video</a>. It was created using a clever photographers effect called &#8217;tilt shift&#8217; which fakes shallow depth of field.</p>
<h3>Step 9</h3>
<p>With your understanding of fStop, you should know that light bulbs are fairly small and as a result will need a smaller fStop value. So go ahead and set it to 3.5.</p>
<p><img class="aligncenter size-full wp-image-740" title="fstop" src="http://www.blenderguru.com/wp-content/uploads/2009/11/fstop.jpg" alt="fstop" width="540" height="372" /></p>
<h3>Step 10</h3>
<p>Another interesting aspect of DoF that you have control over is  <em>bokeh, </em>which defines the shape of the out of focus lights in your scene. Typically old cameras suffered from jagged bokeh but as technology improved the bokeh took on a more circular shape.</p>
<div id="attachment_759" class="wp-caption aligncenter" style="width: 328px"><a href="http://www.flickr.com/photos/wisdoc/359358456/"><img class="size-full wp-image-759" title="reference-bokeh" src="http://www.blenderguru.com/wp-content/uploads/2009/11/reference-bokeh.jpg" alt="reference-bokeh" width="318" height="500" /></a><p class="wp-caption-text">So smooth.</p></div>
<p>However I have found that using a polygonal shape like a hexagon can give a more unique effect. So go ahead and change the bokeh type to <em>Hexagonal </em>and Rotate to <em>90</em></p>
<p><img class="aligncenter size-full wp-image-743" title="hexagon-901" src="http://www.blenderguru.com/wp-content/uploads/2009/11/hexagon-901.jpg" alt="hexagon-901" width="540" height="372" /></p>
<p>The 90 degree rotation simply turns the hexagon on it&#8217;s side to make it more obvious.</p>
<h3>Step 11</h3>
<p><img class="aligncenter size-full wp-image-745" title="do_composite" src="http://www.blenderguru.com/wp-content/uploads/2009/11/do_composite.jpg" alt="do_composite" width="540" height="204" /></p>
<p>Press <em>Do Composite </em>in the render panel (F10), and hit render!</p>
<p>If you&#8217;re a beginner you can stop here as you probably won&#8217;t need the next step for your scene, but feel free to read on if you want to get into the tricky stuff.</p>
<h3>Using DoF with Multiple Render Layers</h3>
<p>You may notice that in the final product, the light filaments of the light bulbs are glowing. To achieve this effect I had to move the filaments to the second layer and make it into a separate render layer.</p>
<div id="attachment_746" class="wp-caption aligncenter" style="width: 550px"><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/glow-layer.jpg"><img class="size-medium wp-image-746" title="glow-layer" src="http://www.blenderguru.com/wp-content/uploads/2009/11/glow-layer-540x224.jpg" alt="glow-layer" width="540" height="224" /></a><p class="wp-caption-text">Glowing node setup</p></div>
<p>However, when you do this a problem arises: the Z-Depth for the DoF was calculated on the first layer, not the second. Sure, it&#8217;d be great if we could just jam two outputs from different render layers into the one hole, but sadly this is not the case.</p>
<div id="attachment_737" class="wp-caption aligncenter" style="width: 542px"><img class="size-full wp-image-737" title="if-only" src="http://www.blenderguru.com/wp-content/uploads/2009/11/if-only.jpg" alt="if-only" width="532" height="436" /><p class="wp-caption-text">It&#39;s photoshopped. Please don&#39;t try this at home.</p></div>
<p>The ugly truth is: each render layer needs a separate defocus node. <em>Always. </em>However rather than adding it the traditional way and having to adjust the settings on each node to match the other, I have a far more painless way.</p>
<p>Select the original defocus node and hit Ctrl-G.</p>
<p><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group.jpg"><img class="aligncenter size-full wp-image-747" title="defocus_group" src="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group.jpg" alt="defocus_group" width="540" height="435" /></a></p>
<p><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group2.jpg"><img class="aligncenter size-full wp-image-748" title="defocus_group2" src="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group2.jpg" alt="defocus_group2" width="540" height="204" /></a></p>
<p>This will make the single node into a group. Calling it a group is confusing, but if you duplicate it (Shift-D) you will notice that a number appears next to it&#8217;s name.</p>
<p><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group_duplicated.jpg"><img class="aligncenter size-full wp-image-749" title="defocus_group_duplicated" src="http://www.blenderguru.com/wp-content/uploads/2009/11/defocus_group_duplicated.jpg" alt="defocus_group_duplicated" width="540" height="358" /></a></p>
<p>This is the number of users associated with it. Meaning you can make several copies of it and everything in it will mirror the settings of the groups.</p>
<p>Duplicate the group for each render layer in your scene, and compile the layers as you normally would.</p>
<div id="attachment_750" class="wp-caption aligncenter" style="width: 550px"><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/complete_node_setup.jpg"><img class="size-medium wp-image-750" title="complete_node_setup" src="http://www.blenderguru.com/wp-content/uploads/2009/11/complete_node_setup-540x210.jpg" alt="complete_node_setup" width="540" height="210" /></a><p class="wp-caption-text">Complete node setup</p></div>
<p style="text-align: center;">Voila!</p>
<p style="text-align: center;"><a href="http://www.blenderguru.com/wp-content/uploads/2009/11/finished-scene.blend"><img class="aligncenter size-medium wp-image-751" title="download_finished_blend" src="http://www.blenderguru.com/wp-content/uploads/2009/11/download_finished_blend-540x253.jpg" alt="download_finished_blend" width="540" height="253" /></a></p>
<p style="text-align: left;"><!--more-->Thanks for reading! I hope you now have a better understanding of this often overlooked feature in Blender. If there&#8217;s something I&#8217;ve missed or anything you&#8217;d like me to go into more detail, please let me know in the comment section below!</p>
<p class='fb-like'><iframe src='http://www.facebook.com/plugins/like.php?href=http://www.blenderguru.com/creating-depth-of-field/&amp;layout=button_count&amp;show_faces=true&amp;width=260&amp;action=like&amp;colorscheme=light' scrolling='no' frameborder='0' allowTransparency='true' style='border:none; overflow:hidden; width:260px; height:26px'></iframe></p>]]></content:encoded>
			<wfw:commentRss>http://www.blenderguru.com/creating-depth-of-field/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
	</channel>
</rss>
