<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Crunks Blog &#187; Rendering</title>
	<atom:link href="http://www.artbycrunk.com/blog/category/tutorials/rendering-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artbycrunk.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 18 Jul 2010 16:07:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
			<title>Crunks Blog</title>
			<url>http://www.artbycrunk.com/blog_favicon.png</url>
			<link>http://www.artbycrunk.com/blog</link>
			<width></width>
			<height></height>
			<description></description>
		</image>		<item>
		<title>Ambient Occlusion &#8211; Using mib_amb_occlusion node</title>
		<link>http://www.artbycrunk.com/blog/2009/03/ambient-occlusion-using-mib_amb_occlusion_node/</link>
		<comments>http://www.artbycrunk.com/blog/2009/03/ambient-occlusion-using-mib_amb_occlusion_node/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 20:34:16 +0000</pubDate>
		<dc:creator>Crunk</dc:creator>
				<category><![CDATA[Rendering]]></category>
		<category><![CDATA[maya]]></category>
		<category><![CDATA[miLabel]]></category>
		<category><![CDATA[occlusion]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.artbycrunk.com/blog/?p=288</guid>
		<description><![CDATA[<br/>Occlusion is a fast and simple method to simulate the effects of global illumination. Ambient occlusion is most often calculated by casting rays in every direction from the surface. Rays which reach the background or “sky” increase the brightness of the surface, whereas a ray which hits any other object contributes no illumination. As a result, points surrounded by a large amount of geometry are rendered dark, where as points with little geometry on the visible hemisphere appear light. The soft appearance achieved by ambient occlusion alone is similar to the way an object appears on an overcast day. So what basically this shader does is try to re-create the effect of ambient occlussion. It is moderately low on render time, and has significant advantanges in the final look of an image. The mib_amb_occlusion node come with a variety of attributes to customize the final rendered AO image.]]></description>
			<content:encoded><![CDATA[<br/><p>Occlusion is a fast and simple method to simulate the effects of global illumination. Ambient occlusion is most often calculated by casting rays in every direction from the surface. Rays which reach the background or “sky” increase the brightness of the surface, whereas a ray which hits any other object contributes no illumination. As a result, points surrounded by a large amount of geometry are rendered dark, where as points with little geometry on the visible hemisphere appear light. The soft appearance achieved by ambient occlusion alone is similar to the way an object appears on an overcast day. So what basically this shader does is try to re-create the effect of ambient occlussion. It is moderately low on render time, and has significant advantanges in the final look of an image. The <strong>mib_amb_occlusion</strong> node come with a variety of attributes to customize the final rendered AO image.</p>
<p>First off the ambient occlussion node is a mental ray node so, so u would require the <strong>mayatomr</strong> plugin to be enabled. The ambient occlusion node can be found in the Hypershade under <strong>Create &gt; MentalRay Textures &gt; mib_amb_occlusion</strong>.</p>
<p><img class="alignnone size-full wp-image-291" title="occ_image_0" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_0.jpg" alt="occ_image_0" width="301" height="41" /></p>
<p>There are various ways to connect the mib_amb_occlusion node to the desired object.</p>
<p><strong>1. </strong>The first is the preset that comes with maya`s render layer system, which makes a surface shader and connects the mib_amb_occlusion node to the surface shaders outColor.</p>
<p><img class="alignnone size-full wp-image-292" title="occ_image_1" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_1.jpg" alt="occ_image_1" width="474" height="213" /><br />
<strong>2. </strong>In this case one can connect the mib_amb_occlusion node`s outValue to the ambient or Incandescence of any desired shader. The connetions are the same as above expect for the fact that u would not connect to outColor but to ambient or Incandescence.</p>
<p><strong>3.</strong> One can also connect the mib_amb_occlusion node to the shading group of a material, the the shading groups attributes there will be a mental ray tab with a field called Material Shader.</p>
<p><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_2.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-293" title="occ_image_2" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_2.jpg" alt="occ_image_2" width="518" height="167" /></a></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Samples</strong></h3>
<p>Controls the overall quality of the occlusion. Increasing the number of samples will reduce noise and give u a smoother render, the higher the number the more expensive the render cost. It quite easy to go overboard with this attribute, so know when to quit.</p>
<p>Default &#8211; <strong>16</strong></p>
<p><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_3.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-294" title="occ_image_3" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_3.jpg" alt="occ_image_3" width="520" height="193" /></a></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Bright / Dark</strong></h3>
<p>These two sliders control the lightest/darkest color of the occlusion. It can work as a clamp to keep the black and white range under a limit or one can change the colors for other desired looks.</p>
<p>Default -<strong> White/Black</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_4.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-295" title="occ_image_4" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_4.jpg" alt="occ_image_4" width="518" height="202" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Spread</strong></h3>
<p>Spread is the basic dropoff between the bright and the dark colors in the occlusion. A higher spread will require more samples.</p>
<p>Default <strong>- 0.800</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_5.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-296" title="occ_image_5" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_5.jpg" alt="occ_image_5" width="520" height="189" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Max Distance</strong></h3>
<p>Max Distance is the how far a ray of occlusion will go in search of another object to occlude. Zero is basically all objects in infinity will occlude each other.</p>
<p>Default<strong> &#8211; 0.800</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_6.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-297" title="occ_image_6" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_6.jpg" alt="occ_image_6" width="520" height="283" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Falloff</strong></h3>
<p>This attribute is only useable if the max distance is not eqaul to zero. It is basicall how fast the occulussion effect with die out with have over the distance.</p>
<p>Default<strong> &#8211; 1</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_7.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-298" title="occ_image_7" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_7.jpg" alt="occ_image_7" width="522" height="281" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Reflective</strong></h3>
<p>When turned on, the occlussion will reflect on surronding objects. This is good when u have a lot of reflective objects in the scene.</p>
<p>Default<strong> &#8211; Off</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_8.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-299" title="occ_image_8" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_8.jpg" alt="occ_image_8" width="519" height="161" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Output Mode</strong></h3>
<p>This constits of three modes, that defines what the returned color will be.</p>
<p>Default<strong> &#8211; 0</strong></p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_9.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-300" title="occ_image_9" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_9.jpg" alt="occ_image_9" width="521" height="120" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Occlusion In Alpha</strong></h3>
<p>When turned on, the occlussion will show up in the alpha channel, For this to work u will have to use the 3rd step in connecting the shader to the ShadingGroup Node.<br />
<strong>Turn on Pass Custom Alpha Channel  in the Render Settings &gt; MentalRay Tab  &gt; Under Custom Entities</strong>.</p>
<p><strong><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_10.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-301" title="occ_image_10" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_10.jpg" alt="occ_image_10" width="523" height="109" /></a></strong></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>Occlusion &amp; Transparency</strong></h3>
<p>By default occlusion does not respect transparecy, then if u need transparent objects to be occluded, u will need to connect the AO shader to the amient or incandescence.</p>
<p><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_11.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-310" title="occ_image_11" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_11.jpg" alt="occ_image_11" width="519" height="299" /></a></p>
<p>__________________________________________________________________________________________</p>
<h2><strong>miLabel Attribute</strong></h2>
<p>For the next two options to work  i.e id_inclexcl and id_nonself, all your objects need to be assigned with id numbers, and these id numbers need to be added in a new attribute called miLabel. So for the below to options to work you will need to add an attribute to each and every geometry in the scene, and give it an id number.</p>
<p><img title="occ_image_11" src="http://www.artbycrunk.com/blog/wp-content/thumbs/Maya.png" alt="occ_image_11" width="25" height="30" /> <strong>MEL SCRIPT</strong></p>
<p>I have made a script for this purpose called <a href="http://www.artbycrunk.com/blog/2009/03/scripts-crassignid/" target="_blank">crAssignID</a> that lets u add the attribite and assingn id numbers to a group of selected objects.<br />
It has a couple of helpfull options and can be found below, or looking into the scripts section of this blog.</p>
<p><a href="http://www.artbycrunk.com/blog/2009/03/scripts-crassignid/" target="_blank">http://www.artbycrunk.com/blog/2009/03/scripts-crassignid/</a></p>
<p>__________________________________________________________________________________________</p>
<h3><strong>id_inclexcl</strong></h3>
<p>This is basically an include/exclue from occlusion.<br />
0 means that this attribute will have no effect. Same value as the miLabel means that only those objects can cause occlusion.<br />
A Negative value of the miLabel means that those objects will not cause any occlusion.</p>
<h3><strong>id_nonself</strong></h3>
<p>This is basically an self or non self occlussion option again<br />
0 means this atttribute will have no effect. Same value as the miLabel means that those object will not self occlude.</p>
<p><a href="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_12.jpg" rel="wp-prettyPhoto[g288]"><img class="alignnone size-full wp-image-290" title="occ_image_12" src="http://www.artbycrunk.com/blog/wp-content/storage/2009/03/occ_image_12.jpg" alt="occ_image_12" width="522" height="166" /></a></p>
<p>This is difficult to explain how these two attributes really works, you will just need to try it out yourself. If u have any problems please leave a comment :)</p>
<p>__________________________________________________________________________________________</p>
<p><strong><br />
</strong></p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.artbycrunk.com/blog/2009/03/ambient-occlusion-using-mib_amb_occlusion_node/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
