<?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>Brian Freisinger &#187; Vray</title>
	<atom:link href="http://www.disopolis.com/wordpress/category/tutorials/cg/vray/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.disopolis.com/wordpress</link>
	<description>VFX portfolio</description>
	<lastBuildDate>Sat, 13 Apr 2013 01:39:15 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>xyzWPP pass tutorial</title>
		<link>http://www.disopolis.com/wordpress/2012/xyzwpp-pass-tutorial/</link>
		<comments>http://www.disopolis.com/wordpress/2012/xyzwpp-pass-tutorial/#comments</comments>
		<pubDate>Tue, 06 Nov 2012 01:41:34 +0000</pubDate>
		<dc:creator><![CDATA[faust]]></dc:creator>
				<category><![CDATA[CG]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Nuke]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Vray]]></category>
		<category><![CDATA[vray wpp pass]]></category>
		<category><![CDATA[vrayRE_extra_tex]]></category>
		<category><![CDATA[world point position]]></category>
		<category><![CDATA[wpp]]></category>
		<category><![CDATA[xyz]]></category>
		<category><![CDATA[xyzWPP]]></category>

		<guid isPermaLink="false">http://www.disopolis.com/wordpress/?p=259</guid>
		<description><![CDATA[Setting up a xyzWPP pass in vray using the vrayRE_extra_tex   By Brian Freisinger November 5, 2012 (Reminder: Click on images to enlarge) A common request I get from compositors, is for an XYZ WPP pass in addition to my standard passes. The XYZ or World Point Position pass can be used in multiple ways, from [&#8230;]]]></description>
				<content:encoded><![CDATA[<h3 style="text-align: left;"><strong>Setting up a xyzWPP pass in vray using the vrayRE_extra_tex </strong></h3>
<p style="text-align: left;"><strong></strong><span style="color: #808080;"> <em>By Brian Freisinger</em></span></p>
<p style="text-align: left;"><span style="color: #808080;"><em></em><em>November 5, 2012</em></span></p>
<p style="text-align: left;">(Reminder: Click on images to enlarge)</p>
<p style="text-align: left;">A common request I get from compositors, is for an XYZ WPP pass in addition to my standard passes. The XYZ or World Point Position pass can be used in multiple ways, from doing some re-lighting in Nuke, to creating atmosphere (ground fog) and a variety of other uses.</p>
<p style="text-align: left;">The XYZ WPP pass doesn’t appear in the Render Elements tab, so you’ll have to create it using the <strong>vrayRE_Extra_Tex</strong></p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure1.png"><img class="size-medium wp-image-260" title="figure1" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure1-185x300.png" alt="" width="185" height="300" /></a></p>
<p>The vrayRE_Extra_Tex is a very powerful and often underused render element. You can plug almost anything into it to create a custom pass. For example, you can plug the VrayDirt shader into it and kick out basically an ambient occlusion pass. Again, that’s just one of many things that can be plugged into this node to get almost any pass or variant of pass out painlessly and easily.</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure2.png"><img title="figure2" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure2-300x251.png" alt="" width="300" height="251" /></a></p>
<p>For this one I just created a vrayDirt shader in the hypershade and dragged and dropped it into the vray_ExtraTex “Texture” field. (Make sure you hit enter after doing this so it connects, otherwise you’ll be wondering why it doesn’t work)</p>
<p>&nbsp;</p>
<h3>Creating the xyzWPP pass</h3>
<p style="text-align: left;">The XYZ WPP pass takes a little more work, but isn’t difficult.<br />
I’m just going to set up some spheres in my scene in a loose array so we have multiple objects that exist in multiple xyz coordinate space to make our pass pretty obvious when we render it.</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure3.png"><img title="figure3" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure3-300x181.png" alt="" width="300" height="181" /></a></p>
<p style="text-align: left;">Next I’m going to create my <strong>vrayRE_Extra_Tex pass</strong>.</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure4.png"><img title="figure4" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure4-300x224.png" alt="" width="300" height="224" /></a></p>
<p style="text-align: left;">Make sure you open the vrayRE_Extra_Tex up in the attribute editor.<br />
You’ll see some empty fields.<br />
The first field we want to fill is the Vray Name Extratex, without a name in here it’ll be a blank field in the VFB, and hard to find as a comp pass later.<br />
So I’m just going to name mine xyzWPP</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure5.jpg"><img title="figure5" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure5-185x300.jpg" alt="Figure 5. “Name your pass&quot;" width="185" height="300" /></a></p>
<p style="text-align: left;">Ok, so the xyzWPP pass has now been created, but the render element itself needs to get information, so we’ll create a samplerInfo node in the hypershade.</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure6.png"><img title="figure6" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure6-283x300.png" alt="" width="283" height="300" /></a></p>
<p style="text-align: left;">So we’ve got our samplerInfo node and our xyxWPP pass created. Next we’ll need to get them to talk, so opening up the connection edtor, we want to load the samplerInfo node on the left and the vrayRE_Extra_Tex, on the right.</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure7.png"><img title="figure7" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure7-300x279.png" alt="" width="300" height="279" /></a></p>
<p style="text-align: left;">You can see I’ve expanded the “pointWorld” field on the left, and the vray_texture_extraTex on the right.<br />
So now it’s a simple case of connecting pointWorldX to R, pointWorldY to G, and pointWorldZ to B</p>
<p style="text-align: left;">That’s it. You now have an xyzWPP pass created for your scene.</p>
<p style="text-align: left;">Rendering it can be a bit deceptive. It may not look like there is any gradient to your passes.<br />
The render will all channels on should look something like this</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure-8.png"><img title="figure 8" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure-8-300x177.png" alt="" width="300" height="177" /></a></p>
<p style="text-align: left;">So I’ll load this pass into Nuke, add a shuffle and a grade and take a look at the “G” channel which is assigned to our Y</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure9.png"><img title="figure9" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/11/figure9-300x170.png" alt="" width="300" height="170" /></a></p>
<p style="text-align: left;">I’ve added the grade so I could see a better representation of the gradient I would expect in this pass.</p>
<p style="text-align: left;">And that’s pretty much it. You can look at your X and Z channel and see how they look at this point.</p>
<p style="text-align: left;">For more info about using xyzWPP passes check out some of <a href="http://www.thefoundry.co.uk/">The Foundry’s</a> tutorials.<br />
<strong id="internal-source-marker_0.5798456333577633"><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.disopolis.com/wordpress/2012/xyzwpp-pass-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Part 4: Multi-Tile Displacement Mapping/Shader Assignment</title>
		<link>http://www.disopolis.com/wordpress/2012/part-4-multi-tile-displacement-mappingshader-assignment/</link>
		<comments>http://www.disopolis.com/wordpress/2012/part-4-multi-tile-displacement-mappingshader-assignment/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 06:27:18 +0000</pubDate>
		<dc:creator><![CDATA[faust]]></dc:creator>
				<category><![CDATA[CG]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Mudbox]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Vray]]></category>
		<category><![CDATA[displacement]]></category>
		<category><![CDATA[maya multi tile displacement]]></category>
		<category><![CDATA[multi tile displacement]]></category>
		<category><![CDATA[multi-tile]]></category>
		<category><![CDATA[multiple UV mapping]]></category>
		<category><![CDATA[multiple uv tile displacement]]></category>
		<category><![CDATA[multiple uv tiles]]></category>
		<category><![CDATA[multitile displacement]]></category>
		<category><![CDATA[tiled displacement]]></category>

		<guid isPermaLink="false">http://www.disopolis.com/wordpress/?p=211</guid>
		<description><![CDATA[Multi-Tile UV Mapping/Displacement Part 4 By Brian Freisinger June 9, 2012 &#160; (This tutorial is designed around Maya and Mudbox. Several of the concepts here can be transposed into other 3d software packages that have UV grid control) This is a continuation of the multi tile UV mapping tutorial. Click on the images to enlarge [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2></h2>
<p><strong>Multi-Tile UV Mapping/Displacement Part 4</strong></p>
<p><span style="color: #808080;"><em>By Brian Freisinger</em></span></p>
<p><span style="color: #808080;"><em>June 9, 2012</em></span></p>
<p>&nbsp;</p>
<p>(This tutorial is designed around Maya and Mudbox. Several of the concepts here can be transposed into other 3d software packages that have UV grid control)</p>
<p>This is a continuation of the <a href="http://www.disopolis.com/wordpress/?p=81">multi tile UV mapping tutoria</a>l.</p>
<p>Click on the images to enlarge for more detail.</p>
<p>&nbsp;</p>
<p>To understand how to layout the ‘tiles’ for maya and mudbox please refer to <a href="http://www.disopolis.com/wordpress/?p=81">Multi-Tile UV Mapping Part 1</a></p>
<p>Here we will cover both how to use displacement with multi-tile UV mapping, as well as an alternate method of assigning multi-tile color.</p>
<p>&nbsp;</p>
<p><strong>Why 32 bit?</strong></p>
<p>(if you already use 32 bit and don’t want a history lesson you can skip to the ‘how’ part)</p>
<p>&nbsp;</p>
<p>First off, we’ll discuss 32 bit displacement vs 8 or 16 bit.</p>
<p>I highly recommend using 32 bit .exr format for anything you’ve done custom sculpting on in Mudbox or Zbrush.</p>
<p>8 and 16 bit have a variety of problems, so does .tif format.</p>
<p>The main problem with anything less than 32 bit is it only goes in a single normal direction. I.E. it’s only 16 (or 8) bit in or out.</p>
<p>&nbsp;</p>
<p>What’s this mean? If you sculpt a landscape and have hills and valleys, and export a 16 bit, it’s either going to have only the hills or the valleys. To get both you’d need two 16 bit maps, one for the positive normal values (the hills) and one for the negative (the valleys)</p>
<div id="attachment_213" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure1.jpg"><img class="size-medium wp-image-213" title="figure1" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure1-300x217.jpg" alt="" width="300" height="217" /></a><p class="wp-caption-text">16 in/16 out/water level</p></div>
<p>&nbsp;</p>
<p>32 bit will handle both at the same time, so we only have a single file to work with.</p>
<p>&nbsp;</p>
<p>Another pitfall to 16 bit or less is the need to adjust the map to display correctly. The user may need to shift the displacement +/- to get it to render 1:1 as expected from the sculpt.</p>
<p>32 bit knows about this internally based off the scale of the object, so it’s simply assign and render to get the same levels of displacement one would expect to see based off your sculpt.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>IMPORTANT:</p>
<p>Because 32 bit does recognize the scale of the object you started with, change the scale AFTER you’ve sculpted and extracted displacement maps can have unexpected and mostly undesirable effects on your displacement render.</p>
<p>Scaling the object up will reduce the displacement amount to almost non existent, and scaling an object down will result in it looking ‘exploded’ or blown up.</p>
<p>So before painting a 32 bit displacement map it is very important to ESTABLISH THE SCALE OF YOUR OBJECT. If you paint on an object that is 5 cm across only to find out it needs to be 5 meters in the scene will cause some problems for you.</p>
<p>There are some workarounds using Nuke to change the scale, and it is possible to scale up and object in mudbox and then re-extract if a mistake is made, but it’s better to start with a properly scaled object.</p>
<p>Last thing. Mudbox saves an LZW compression tif. Bluntly this is horrible. Maya won’t read it, so you need to take it into Photoshop (which clamps your 32bit map and ruins the high/low details) or into Nuke to save it out in a non-compressed format. The EXR format saves properly, is lighter than tif and retains far more fidelity to the original sculpt.</p>
<p>In my personal opinion the whole .tif format is horrible. I use .png for color and .exr for displacement.</p>
<p>Ok, we’ll now move on to the how.</p>
<p>&nbsp;</p>
<p><strong>Extracting the displacement map.</strong></p>
<div id="attachment_214" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure2.jpg"><img class="size-medium wp-image-214" title="figure2" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure2-300x184.jpg" alt="" width="300" height="184" /></a><p class="wp-caption-text">multi tile layout</p></div>
<p>&nbsp;</p>
<p>Using the same cube and six tile UV layout from part 1 we’ll paint a quick displacement map in Mudbox.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Two quick protips here:</p>
<div id="attachment_215" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure3.jpg"><img class="size-medium wp-image-215" title="figure3" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure3-300x265.jpg" alt="" width="300" height="265" /></a><p class="wp-caption-text">“bleed”</p></div>
<p>&nbsp;</p>
<p>One it’s good practice to ‘bleed’ your UV map at least 5% away from the edge of the 0,1 grid tile.</p>
<p>The reason here is mudbox might return some errors in the edge of the displacement if it doesn’t have some room for bleed calculations. This also applies to multiple shells in a UV tile. If you have several UV maps separated out in a single tile you should have space between each shell to get a good extraction.</p>
<p>&nbsp;</p>
<p>Two, as discussed before double check your scale before exporting an object to mudbox.</p>
<p>My cube is 5 cm in XYZ for this tutorial.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_216" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure4.jpg"><img class="size-medium wp-image-216" title="figure4" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure4-300x270.jpg" alt="" width="300" height="270" /></a><p class="wp-caption-text">subdivision on cube</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I am also going to pre subdivide the cube now so it keeps it’s ‘cubeness’ instead of turning into a sphere on subdivision.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_217" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure5.jpg"><img class="size-medium wp-image-217" title="figure5" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure5-300x271.jpg" alt="" width="300" height="271" /></a><p class="wp-caption-text">Major work of art. VES award here I come.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I did a quick displacement sculpt in Mudbox, nothing to fancy just enough to get the point across.</p>
<p>The point of this is to get the sculpt detail and the highs and lows to show up the same in our render.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_219" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure6.jpg"><img class="size-medium wp-image-219" title="figure6" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure6-300x231.jpg" alt="" width="300" height="231" /></a><p class="wp-caption-text">level 0 issue</p></div>
<p>&nbsp;</p>
<p>Another catch is mudbox has a nasty habit of effecting the base model when you’re sculpting.</p>
<p>So if we look back at our level 0 model we can see the high and low peaks I sculpted in are in the ‘zero’ level model.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I don’t know if this is a bug or a feature, but it’s a problem. You have two solutions here.</p>
<p>One is to export this model and use it as your new base mesh in Maya.</p>
<p>I do this often.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_222" style="width: 284px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure7.jpg"><img class="size-medium wp-image-222" title="figure7" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure7-274x300.jpg" alt="" width="274" height="300" /></a><p class="wp-caption-text">renamed sculpt</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>But in the event your model is so far down the pipeline this isn’t possible then I suggest the following.</p>
<p>Select your sculpted object and rename it to something like ‘highrezExtract’ or similar.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_223" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure8.jpg"><img class="size-medium wp-image-223" title="figure8" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure8-300x171.jpg" alt="" width="300" height="171" /></a><p class="wp-caption-text">Original and Sculpt in scene</p></div>
<p>&nbsp;</p>
<p>Next in the same scene import the original pre sculpted object.</p>
<p>You should now have two objects in your scene. One you sculpted and the original one you exported from Maya.</p>
<p>&nbsp;</p>
<p>The yellow object is the selected ‘high resolution sculpt, the other is the one I started with by doing a Maya OBJ export.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_225" style="width: 106px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure9.jpg"><img class="size-medium wp-image-225" title="figure9" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure9-96x300.jpg" alt="" width="96" height="300" /></a><p class="wp-caption-text">“extracting from two models”</p></div>
<p>&nbsp;</p>
<p>Now we  need to extract the displacement maps.</p>
<p>For mudbox that’s: Maps -&gt; Extract Texture Maps</p>
<p>Obviously we’re doing displacement.</p>
<p>But because we have two objects we’re going to do a ‘difference’ between the two. So when we select our models we’ll want the original in “Target” and the high resolution in “Source”</p>
<p>This is why renaming them is handy. To know which goes where without confusion. Extraction can take a long time, so minimising mistakes is handy.</p>
<p>&nbsp;</p>
<p>We also have to use the “Ray Casting” method because we’re doing a compare/difference between the two.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_226" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure10.jpg"><img class="size-medium wp-image-226" title="figure10" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure10-300x207.jpg" alt="" width="300" height="207" /></a><p class="wp-caption-text">Closest to Target</p></div>
<p>&nbsp;</p>
<p>One thing of note here:</p>
<p>I want to extract a 32 bit map with both in and out, so I need to make sure “closest to lowres mesh’ (i.e. closest to target) is selected. This will look both inside and outside the mesh.</p>
<p>There are several other tricks and settings in mudbox for getting a good displacement map out, but they can be found in tutorals all over the web, so I’ll leave that to you.</p>
<p>One little trick though is figuring out your search distance. I know my cube was 5cm so I want to make sure my search distance goes out beyond that since I sculpted “out” quite a bit.</p>
<p>I eventually made the search distance 1.0 so the high peak on the top wouldn’t clip.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_228" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure11.jpg"><img class="size-medium wp-image-228" title="figure11" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure11-300x261.jpg" alt="" width="300" height="261" /></a><p class="wp-caption-text">file name and EXR type</p></div>
<p>&nbsp;</p>
<p>Another quick tip:</p>
<p>I named my file cubemaps_01 not cubemaps_v01</p>
<p>A lot of people like to put a v for ‘version’ behind their file iterations. While not a bad practice it can come back to haunt you with Mudbox. Mudbox uses v and u to siginify which UV tile it belongs to (see previous tutorial)</p>
<p>So if I had named this cubemap_v01 instead I’d get a file outputs that said:</p>
<p>cubemap_v01_u1_v1.exr, cubemap_v01_u2_v1.exr, etc</p>
<p>Not only is this confusing on a quick glance when you need to assign your maps to the shader, it will also confuse mudbox if you need to reload your maps back onto a mesh in mudbox (Sculpt using map). Mudbox won’t be able to figure out what map belongs to what tile. So I strongly suggest not using the ‘v’ or version letter for your displacement maps.</p>
<p>&nbsp;</p>
<p>Also use the OpenEXR 32 bit floating Point RGBA file type, not the Black and White.</p>
<p>I can’t speak for other programs, but Maya has a problem reading the Black and White.</p>
<p>&nbsp;</p>
<div id="attachment_229" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure12.jpg"><img class="size-medium wp-image-229" title="figure12" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure12-300x84.jpg" alt="" width="300" height="84" /></a><p class="wp-caption-text">4k maps</p></div>
<p>&nbsp;</p>
<p>My maps are now extracted (I did 4k maps for detail)</p>
<p>As we’ve seen in the previous tutorials, I have six maps with coordinates exported (one for each tile)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now we’ll need to create a shader to render these in Maya.</p>
<p>I’m using Vray, but this technique works for Renderman, Mental Ray or almost any other render engine on the market.</p>
<p>&nbsp;</p>
<p><strong>Creating the multi tile displacement shader</strong></p>
<p>In my previous tutorial for color maps I used the layered texture shader. I’ve actually moved away from this because, well it sucks. I’m currently using the “plusMinusAverage” node for both my color and displacement.</p>
<p>The main reason here, is the layered texture shader in addition to being rather buggy, also does not respect negative values.</p>
<p>That means anything you paint going ‘IN’ won’t show up or worse show up as ‘clipped’ when you render. That’s a huge problem.</p>
<div id="attachment_230" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure13.jpg"><img class="size-medium wp-image-230" title="figure13" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure13-300x212.jpg" alt="" width="300" height="212" /></a><p class="wp-caption-text">+/- Average</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>So the solution is to use the +/- average node.</p>
<p>&nbsp;</p>
<p>That node will come in handly later, but lets start by setting up our shader.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I’m using Vray here so I’ll create a Vray shader. But if you’re using another render engine the principle is the same.</p>
<p>&nbsp;</p>
<div id="attachment_231" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure14.jpg"><img class="size-medium wp-image-231" title="figure14" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure14-300x243.jpg" alt="" width="300" height="243" /></a><p class="wp-caption-text">Create displacement node</p></div>
<p>&nbsp;</p>
<p>I need to set up/create a displacement node that’s hooked into my shader.</p>
<p>for Vray I need to go to the SG (or shading group) and create a file node.</p>
<p>What this is doing (for Vray) is creating a vray native displacement node.</p>
<p>&nbsp;</p>
<p>Again, if you’re using Arnold, Renderman, MentalRay, etc, hook your displacment node up.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_232" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure15.jpg"><img class="size-medium wp-image-232" title="figure15" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure15-300x159.jpg" alt="" width="300" height="159" /></a><p class="wp-caption-text">displacement node</p></div>
<p>&nbsp;</p>
<p>Once I’ve created it I actually delete the file node itself. I just need the displacement node to hook into later.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_233" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure16.jpg"><img class="size-medium wp-image-233" title="figure16" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure16-300x87.jpg" alt="" width="300" height="87" /></a><p class="wp-caption-text">Attach luminance to displacement.</p></div>
<p>&nbsp;</p>
<p>Next we’ll create a luminance node.</p>
<p><span style="color: #ff0000;">(NOTE: If you&#8217;re using this technique  of  plus/minus Average node instead of a layered shader for color maps DO NOT use the luminance node or it will change all your color maps to black and white)</span></p>
<p>This is the big trick to getting Maya to recognize negative values in a multi tile displacement set up. Without this node we will have our displacement all going “out” but nothing going in. So best case scenario it won’t look exactly like the sculpt, worst case it’ll clip and you’ll have smooth artifacts in the render. So save yourself pain and make a luminance node.</p>
<p>&nbsp;</p>
<p>So if we go back to the displacement node we made, we’ll be replacing the file node we deleted with the luminance node. The easiest way to do this is just middle mouse drag the luminance node into the Displacement field of the displacement node.</p>
<p>If you use the connection editor it’s the ‘outvalue’ of the luminance node to the ‘displacement’ of the displacement node.</p>
<p>&nbsp;</p>
<div id="attachment_234" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure17.jpg"><img class="size-medium wp-image-234" title="figure17" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure17-300x95.jpg" alt="" width="300" height="95" /></a><p class="wp-caption-text">Attach +/- Average to Luminance</p></div>
<p>Now we’re going to use the +/- Average node we looked at earlier.</p>
<p>So create a “+/- Average” node and then middle mouse drag it to the “Value” field in the “Luminance“ node.</p>
<p>In the connection editor it’s the “3DOutput” of the +/- Average node connected to the “Value” of the Luminance node.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_235" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure18.jpg"><img class="size-medium wp-image-235" title="figure18" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure18-300x298.jpg" alt="" width="300" height="298" /></a><p class="wp-caption-text">Create six “input 3d fields”</p></div>
<p>&nbsp;</p>
<p>Now we’ll need to create slots in our +/- Average that will connect with our multiple displacement files.</p>
<p>This tutorial has 6 files, one for each side of our cube, so we’ll need to create six “slots”</p>
<p>So, select the +/- Average node you’ve created and go to the attribute editor.</p>
<p>You’ll see a field called Input 3D, and the option button to “Add New Item” if you click on this 6 times, you’ll now have six fields ready to be connected.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_236" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure19.jpg"><img class="size-medium wp-image-236" title="figure19" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure19-300x107.jpg" alt="" width="300" height="107" /></a><p class="wp-caption-text">Create file node</p></div>
<p>&nbsp;</p>
<p>We’ll now need six file nodes to hook up to the Input 3D field</p>
<p>&nbsp;</p>
<p>There are a few things we’ll need to do with the file nodes next. A lot of these were covered in the previous multi tile color mapping tutorial, but we’ll go over them again.</p>
<p>&nbsp;</p>
<div id="attachment_237" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure20.jpg"><img class="size-medium wp-image-237" title="figure20" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure20-300x261.jpg" alt="" width="300" height="261" /></a><p class="wp-caption-text">File Node Attributes</p></div>
<p>Open the Attribute editor of your first file node.</p>
<p>FIrst I’ll load my first displacement map in which is cubemaps_01_u1_v1.exr</p>
<p>Next I’ll make my Default Color a solid black. If you fail to do this with either color maps or displacement maps you’ll get some rather undesirable effects. Because the node we’re using is additive we don’t want any other color introduced. I’ll spare you the long story, but just make sure you’re set to solid black. If you render looks weird, double check you did this.</p>
<p>&nbsp;</p>
<p>Next we’ll go over the the place2dTexture node which is attached to the file node you made.</p>
<p>In here we’ll have a couple things to change.</p>
<p>Because this is our first map the “Translate Frame” values are left alone.</p>
<p>Mudbox numbers it’s first tile u1_v1, but in Maya it’s u0_v0</p>
<p>&nbsp;</p>
<p>No, I have no idea why they do this.</p>
<p>Wrap U and Wrap V need to be unchecked. We have multi tiles, so we want one per tile at this point.</p>
<p>&nbsp;</p>
<p>Just so we’re clear, I’ll load up my next file which is cubemaps_01_u2_v1.exr</p>
<div id="attachment_238" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure21.jpg"><img class="size-medium wp-image-238" title="figure21" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure21-300x252.jpg" alt="" width="300" height="252" /></a><p class="wp-caption-text">next map</p></div>
<p>&nbsp;</p>
<p>So you can see I loaded in cubemaps_01_u2_v1.exr</p>
<p>I made sure the default color was black (you have to do this for every node)</p>
<p>And in the place2dTexture node I’ve turned off the Wrap U and Wrap V again.</p>
<p>The Translate frame field is now set to 1 and 0</p>
<p>I’ve shifted it over 1 tile in u space, and none in v space.</p>
<p>u1_v1 was 0 and 0</p>
<p>u2_v1 is 1 and 0</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>A tile such as u5_v3 would be a translate value of?</p>
<p>4 and 2</p>
<p>It’s easy to loose track of this stuff when you have a lot of displacement tiles to keep some notes and double check your work often.</p>
<p>&nbsp;</p>
<p>So do this for the last 4 file nodes. The should number up to 5 and 0 in Translate Frame</p>
<p>&nbsp;</p>
<div id="attachment_239" style="width: 306px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure22.jpg"><img class="size-medium wp-image-239" title="figure22" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure22-296x300.jpg" alt="" width="296" height="300" /></a><p class="wp-caption-text">all nodes created.</p></div>
<p>&nbsp;</p>
<p>Your hypershade should now look like this</p>
<p>We’ll now need to hook up the file nodes we created to the +/- average node.</p>
<p>Remember the six slots we made in the +/- Average node Output 3D field?</p>
<p>The file nodes will get attached to those.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_240" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure23.jpg"><img class="size-medium wp-image-240" title="figure23" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure23-300x142.jpg" alt="" width="300" height="142" /></a><p class="wp-caption-text">Connection Editor</p></div>
<p>&nbsp;</p>
<p>Open the connection editor (Windows-&gt;General Editors-&gt;Connection Editor)</p>
<p>Select the first file node and click “Reload Left” on the connection editor.</p>
<p>Select the +/- Average node and click “Reload Right” on the connection editor.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now select “outColor” in the left column.</p>
<p>Expand the Input 3D fields by clicking the + sign and you’ll see the six fields we created earlier.</p>
<p>Select the first field “input3D[0]”</p>
<p>We’ve now established the connection between the file and the +/- Average node.</p>
<p>We’ll see the line appear in the hypershade showing the connection.</p>
<p>&nbsp;</p>
<p>Now it’s a simple matter of doing this for the next 5 file nodes.</p>
<p>Just click on the next file node in the hypershade and click “Reload Left” in the connection editor again. Hook the next file nodes “outColor” to the next free field, “input3D[1]</p>
<p>Etc etc.</p>
<p>The connection order to the +/- Average node isn’t important.</p>
<p>The order of how they’ll read in render has already been established by the Translate Frame field in the place 2dTexture node.</p>
<p>&nbsp;</p>
<div id="attachment_241" style="width: 273px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure24.jpg"><img class="size-medium wp-image-241" title="figure24" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure24-263x300.jpg" alt="" width="263" height="300" /></a><p class="wp-caption-text">displacement shader network.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>When everything is finally hooked up your hypershade graph should look similar to this.</p>
<p>Make sure your shader is assigned to your object, also make sure you’ve flagged whatever subdivision surface attribute your render engine has for the object otherwise you won’t see very much.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now we’ll render the scene.</p>
<p>&nbsp;</p>
<div id="attachment_242" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure25.jpg"><img class="size-medium wp-image-242" title="figure25" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/06/figure25-300x214.jpg" alt="" width="300" height="214" /></a><p class="wp-caption-text">Multi Tile Displacement Render</p></div>
<p>&nbsp;</p>
<p>Success. It looks identical to the sculpt.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Basic troubleshooting for renders that don’t work.</p>
<p>Do I have the right files hooked up?</p>
<p>Did my displacement extractions actually work properly? (view them in Nuke or Photoshop to check)</p>
<p>Do I have my tiles and default color set correctly?</p>
<p>Did I remember to hook up a Luminance node.</p>
<p>Is it all piping into the correct displacement node.</p>
<p>&nbsp;</p>
<p>And that’s it. Enjoy your multi tiling displacement.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.disopolis.com/wordpress/2012/part-4-multi-tile-displacement-mappingshader-assignment/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Vray Light Select Script</title>
		<link>http://www.disopolis.com/wordpress/2012/vray-light-pass-script/</link>
		<comments>http://www.disopolis.com/wordpress/2012/vray-light-pass-script/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 07:58:04 +0000</pubDate>
		<dc:creator><![CDATA[faust]]></dc:creator>
				<category><![CDATA[CG]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Mudbox]]></category>
		<category><![CDATA[Nuke]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Vray]]></category>
		<category><![CDATA[vray compositing]]></category>
		<category><![CDATA[vray light select]]></category>
		<category><![CDATA[vray light select re]]></category>
		<category><![CDATA[vray light select render element]]></category>
		<category><![CDATA[vray lights]]></category>
		<category><![CDATA[vray Render Elements]]></category>
		<category><![CDATA[Vray Specular]]></category>
		<category><![CDATA[vray_light_select]]></category>

		<guid isPermaLink="false">http://www.disopolis.com/wordpress/?p=176</guid>
		<description><![CDATA[Using Vray Render Elements, Making Specular Vray Materials, using Vray_Light_Select, basic Vray Compositing in Nuke. Brian Freisinger Feb 19 2012 UPDATE: May 7 2012 &#8211; The script wasn&#8217;t working correctly in Maya 2012 and Vray 2.2. It&#8217;s been updated to now work properly.  (This tutorial requires Maya 2011 or higher, Vray 2.0 and Nuke or [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Using Vray Render Elements, Making Specular Vray Materials, using Vray_Light_Select, basic Vray Compositing in Nuke.</strong></p>
<p><em>Brian Freisinger</em></p>
<p><em>Feb 19 2012</em></p>
<p><span style="color: #ff0000;">UPDATE: May 7 2012 &#8211; The script wasn&#8217;t working correctly in Maya 2012 and Vray 2.2. It&#8217;s been updated to now work properly.</span></p>
<p><em> (This tutorial requires Maya 2011 or higher, Vray 2.0 and Nuke or AfterEffects/Photoshop)</em></p>
<p><em><strong>Click on any image to enlarge.</strong></em></p>
<p>For the most part, the vray render elements are very straight forward and easy to access (not to mention easy to set up for composite)</p>
<p>&nbsp;</p>
<p>In my opinion, the only one that requires a little more fiddling, as well as opens up a wide variety of user mistakes is the vrayRE_Light_Select.</p>
<p>&nbsp;</p>
<p>This tutorial will only cover very basic light pass/compositing techniques to demonstrate the Light_Select technique and introduce a nice MEL script to make your life easier.</p>
<p>&nbsp;</p>
<div id="attachment_177" style="width: 258px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure1.jpg"><img class="size-medium wp-image-177" title="figure1" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure1-248x300.jpg" alt="" width="248" height="300" /></a><p class="wp-caption-text">Figure 1. Turn on the VFB</p></div>
<p>&nbsp;</p>
<p>The first thing necessary for working with your render elements is to switch over to the Vray VFB (Vray Frame Buffer) to view your images and passes. This will also allow you to quickly view your images in both linear and SRGB color space.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_178" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure2.jpg"><img class="size-medium wp-image-178" title="figure2" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure2-300x216.jpg" alt="" width="300" height="216" /></a><p class="wp-caption-text">Figure 2. Three Light Scene.</p></div>
<p>&nbsp;</p>
<p>I built an simple example scene with a sphere and ground plane. In addition I created three Vray rectangular lights for standard three point lighting.</p>
<p>(Standard maya lights also work for this, but I prefer using the Vray native lights)</p>
<p>&nbsp;</p>
<p>You’ll notice right away I’ve named my lights and objects. It’s just a good standard practice.</p>
<p>It can be as complex or simple as you like, but later on knowing which light you’re looking with or modifying in compositing makes it priceless.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_179" style="width: 255px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure3.jpg"><img class="size-medium wp-image-179" title="figure3" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure3-245x300.jpg" alt="" width="245" height="300" /></a><p class="wp-caption-text">Figure 3. Basic Render Elements for Comp</p></div>
<p>&nbsp;</p>
<p>The first thing we’ll do is set up our Render Elements found under the Render Settings.</p>
<p>You’ll see a huge list of possibilities under this tab, but for simplicity we’ll just do one of the more basic setups.</p>
<p>&nbsp;</p>
<p>As I mentioned before, we’re just going to focus on these basic controls since the point here is about Light Passes, not advanced compositing and pass management.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_180" style="width: 140px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure4.jpg"><img class="size-medium wp-image-180" title="figure4" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure4-130x300.jpg" alt="" width="130" height="300" /></a><p class="wp-caption-text">Figure 4. Specular Material</p></div>
<p>A little note about the specular pass and specular materials in Vray.</p>
<p>More spec and less reflection on an object is controlled by the “Reflection Glossiness” in the Material Editor.</p>
<p>Glossiness set for a mix of spec and reflection.</p>
<p>If the Reflection Glossiness is set for 1.0 you’ll see no specular whatsoever in the spec pass. It’s all being pumped through the reflection pass. Great for a mirror ball, bad for a bowling ball&#8230;</p>
<p>&nbsp;</p>
<p>So for our test I want a mix of both, with hot spec we can see, hence my .632 range.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_181" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure5.jpg"><img class="size-medium wp-image-181" title="figure5" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure5-300x190.jpg" alt="" width="300" height="190" /></a><p class="wp-caption-text">Figure 5. Render in SRGB color space.</p></div>
<p>&nbsp;</p>
<p>Now with the lights set, material set and render elements set we can render.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_182" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure6.jpg"><img class="size-medium wp-image-182" title="figure6" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure6-300x206.jpg" alt="" width="300" height="206" /></a><p class="wp-caption-text">Figure 6. Linear Color Space button.</p></div>
<p>&nbsp;</p>
<p>To switch between linear and SRGB color space you need to click on this button.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I will be writing a tutorial in the future on <strong>Linear Workflow</strong>, but if you’re unfamiliar with it basically in Linear color space the image should look far darker than the SRGB space.</p>
<p>SRGB is how we’re seeing it on our monitor, Linear is the “true” color space and gives us more room to move in compositing especially with our whites/blacks and other post correction.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_183" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure7.jpg"><img class="size-medium wp-image-183" title="figure7" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure7-300x193.jpg" alt="" width="300" height="193" /></a><p class="wp-caption-text">Figure 7. Lighting Pass Only.</p></div>
<p>&nbsp;</p>
<p>Next up is our ability to see our passes using the VFB.</p>
<p>What we’re looking at in the “lighting” pass is simply the combination of the shadow and diffuse pass. We’re also left with very limited control of the lights.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_184" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure8.jpg"><img class="size-medium wp-image-184" title="figure8" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure8-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Figure 8. Basic Nuke Comp</p></div>
<p>&nbsp;</p>
<p>If we were to write these out for compositing they’d be combined with a Plus Merge in Nuke (Linear Dodge/Add in Adobe products)</p>
<p>&nbsp;</p>
<p>So, how do we break each light out separately?</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_185" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure9.jpg"><img class="size-medium wp-image-185" title="figure9" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure9-300x238.jpg" alt="" width="300" height="238" /></a><p class="wp-caption-text">Figure 9. Create a &#8220;Light Select&#8221; pass</p></div>
<p>&nbsp;</p>
<p>We’re going back to our Render Element Tab in the Render Settings and a new pass.</p>
<p>At this point we&#8217;ll need  to use the VrayRE_Light Select to isolate our lights.</p>
<p>As a test we can  just set one up quickly and hook into the render.</p>
<p>Just double click on it as you would any pass and it should appear in the right column.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_186" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure10.jpg"><img class="size-medium wp-image-186" title="figure10" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure10-300x216.jpg" alt="" width="300" height="216" /></a><p class="wp-caption-text">Figure 10. Naming your Pass</p></div>
<p>&nbsp;</p>
<p>Just like we wanted to name our lights earlier, we’ll want to name our Light_Select to know which light it’s controlling.</p>
<p>Let&#8217;s start off by using the keyLight for our test.</p>
<p>&nbsp;</p>
<p>I’m just changing the fields highlighted in green.</p>
<p>The top one effects how it’s seen in the render elements tab as well as the outliner.</p>
<p>The field below it in green effects how it’s seen in the next step, the set editor.</p>
<p>&nbsp;</p>
<p>Currently the “Type” (at the bottom of the image in Figure 10) is set for “Normal”</p>
<p>We’ll get into the more advanced functions of this later.</p>
<p>&nbsp;</p>
<p>Just because the pass was created and named the same as the light doesn’t mean it automagically knows which light to connect to unfortunately.</p>
<p>So we’ll have to open up the set editor.</p>
<p>&nbsp;</p>
<div id="attachment_187" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure11.jpg"><img class="size-medium wp-image-187" title="figure11" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure11-300x277.jpg" alt="" width="300" height="277" /></a><p class="wp-caption-text">Figure 11. Finding the Set Editor</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The set editor is found under: Windows -&gt;Relationship Editors -&gt; Sets</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_188" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure12.jpg"><img class="size-medium wp-image-188" title="figure12" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure12-300x282.jpg" alt="" width="300" height="282" /></a><p class="wp-caption-text">Figure 12. Set Editor Connection</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once the window comes up any Vray Light Select element we’ve made should show up in the left column. This is also why naming your light pass and light is relatively important.</p>
<p>Simply select the light pass on in the left column, and then select the correct light in the right column. In our case it’s the keyLight_pass connected to the keyLight</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_189" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure13.jpg"><img class="size-medium wp-image-189" title="figure13" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure13-300x190.jpg" alt="" width="300" height="190" /></a><p class="wp-caption-text">Figure 13. Key Light Pass</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now if we re-render our image with the VFB active we can look at our keyLight_pass</p>
<p>&nbsp;</p>
<p>We’ve got the light now seperated, but comparing it to the lighting pass and the specular pass we can see that the new pass (keyLight_pass) has not only the lighting, but the specular combined. This will be a problem later on in compositing since generally having your light pass and spec pass separated give a lot more control.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_190" style="width: 143px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure14.jpg"><img class="size-medium wp-image-190" title="figure14" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure14-133x300.jpg" alt="" width="133" height="300" /></a><p class="wp-caption-text">Figure 14. &#8220;Types&#8221; of Light Select</p></div>
<p>&nbsp;</p>
<p>Looking back at the keyLight_pass in the attribute editor we can go down to the bottom and see some options under “<strong>Type</strong>” : Normal, Raw, Diffuse, Specular</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>We left it at default, so now we’ll switch it over to “Diffuse” and re-render the image.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_191" style="width: 166px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure15.jpg"><img class="size-medium wp-image-191" title="figure15" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure15-156x300.jpg" alt="" width="156" height="300" /></a><p class="wp-caption-text">Figure 15. Setting up the diffuse pass</p></div>
<p>&nbsp;</p>
<p>I’m also going to take the time to rename my pass from “keyLight_pass” to “keyLight_diff”</p>
<p>The reason being, we will have to connect up a “keyLight_spec” pass seperately if we want that as an individual control. When they write out a multichannel EXR or single files you’ll want to know what’s what when putting the comp together. It’ll also help diagnose problem using the VFB</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_202" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure16b.jpg"><img class="size-medium wp-image-202" title="figure16b" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure16b-300x197.jpg" alt="" width="300" height="197" /></a><p class="wp-caption-text">Figure 16b. keyLight_diff / diffuse pass only.</p></div>
<p>&nbsp;</p>
<p>The new render shows   that we lost all the spec from our first render.</p>
<p>That’s good, but we’ll need to make another pass to get the spec and hook it up in the set editor.</p>
<p>&nbsp;</p>
<p>Setting this up for production at this point would require six passes just for the lights.</p>
<p>(Three Diffuse and Three Specular) Doing this manually can be a major pain.</p>
<p>First off it’s easy to make a mistake. I’ve often forgot to set a pass to be diffuse, or accidentally set two to be specular. Forget to connect a new pass up in the set editor. Lost all my passes and connections when Maya decided to be helpful and ‘clean up unknown nodes&#8230;’ etc etc</p>
<p>&nbsp;</p>
<p>So I wrote a mel script to do all this for you.</p>
<p>I walked through the process of doing this manually so we’d understand what’s going on under the hood.</p>
<p>&nbsp;</p>
<p>Ok, on with the script:</p>
<p>&nbsp;</p>
<p>Here’s the code:</p>
<p>&nbsp;</p>
<pre>//////////////////////////////<wbr>//////////////////////</wbr></pre>
<pre>//Create Vray LightPass Render Elements//</pre>
<pre>//Dec 2011</pre>
<pre>//Updated May 2012 for Vray 2.2</pre>
<pre>//Brian Freisinger</pre>
<pre>//<a href="mailto:faust@disopolis.com" target="_blank">faust@disopolis.com</a></pre>
<pre>//<a href="http://www.disopolis.com/" target="_blank">www.disopolis.com</a></pre>
<pre>//Feel free to steal, edit, modify.</pre>
<pre>//////////////////////////////<wbr>/////////////////////</wbr></pre>
<pre>//Call selection list</pre>
<pre>global proc vrLightPass () {</pre>
<pre>//Call selection list</pre>
<pre>string $vRE_Light[] = `ls -sl`;</pre>
<pre>for ($selection in $vRE_Light)</pre>
<pre>{</pre>
<pre>string $vrayLS = $selection;</pre>
<pre>string $diff = "_diff";</pre>
<pre>string $spec = "_spec";</pre>
<pre>//create diffuse pass</pre>
<pre>string $diffs = `vrayAddRenderElement LightSelectElement`;</pre>
<pre>string $vRE_diff[];</pre>
<pre>$vRE_diff[0] = $diffs;</pre>
<pre>//set diffuseFLAG</pre>
<pre>setAttr "vrayRE_Light_Select.vray_<wbr>type_lightselect" 2;</wbr></pre>
<pre>//Set render outputname for diffuse</pre>
<pre>setAttr -type "string" vrayRE_Light_Select.vray_name_<wbr>lightselect ($selection + $diff);</wbr></pre>
<pre>rename $vRE_diff ($selection + $diff);</pre>
<pre>//create spec pass</pre>
<pre>string $specs = `vrayAddRenderElement LightSelectElement`;</pre>
<pre>string $vRE_spec[];</pre>
<pre>$vRE_diff[0] = $specs;</pre>
<pre>setAttr "vrayRE_Light_Select.vray_<wbr>type_lightselect" 3;</wbr></pre>
<pre>//Set render outputname for spec</pre>
<pre>setAttr -type "string" vrayRE_Light_Select.vray_name_<wbr>lightselect ($selection + $spec);</wbr></pre>
<pre>rename $vRE_spec ($selection + $spec);</pre>
<pre>//Set relationships</pre>
<pre>connectAttr ($vrayLS + ".instObjGroups[0]") ($vrayLS + "_diff.dagSetMembers[0]");</pre>
<pre>connectAttr ($vrayLS + ".instObjGroups[0]") ($vrayLS + "_spec.dagSetMembers[0]");</pre>
<pre>}</pre>
<pre>}</pre>
<pre>///endcode///</pre>
<p>You can also <a href="http://www.disopolis.com/vrlightpass/">download it here</a> if the wordpress formatting throws you some errors.</p>
<p>Start by sourcing the code.</p>
<p>Then select the lights you want to make passes out of.</p>
<p>I created a keyLight, fillLight and rimLight so I’ll select those three.</p>
<p>then in the command line type</p>
<p>vrLightPass;</p>
<p>and press enter.</p>
<p>&nbsp;</p>
<div id="attachment_192" style="width: 257px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure16.jpg"><img class="size-medium wp-image-192" title="figure16" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure16-247x300.jpg" alt="" width="247" height="300" /></a><p class="wp-caption-text">Figure 16. vrLightPass.mel script</p></div>
<p>&nbsp;</p>
<p>Now I’ve got six passes, all properly named and all properly assigned.</p>
<p>&nbsp;</p>
<p>I really don’t need the original lighting pass or the original specular pass anymore, but I keep them around so when I comp the shot I have something besides the beauty pass around to make sure I got everything right.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_193" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure17.jpg"><img class="size-medium wp-image-193" title="figure17" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure17-300x192.jpg" alt="" width="300" height="192" /></a><p class="wp-caption-text">Figure 17. Rim Light Pass</p></div>
<p>&nbsp;</p>
<p>So now we re-render the image and we’ll take a look at the rimLight_spec pass.</p>
<p>So that’s it. All our light passes are broken out.</p>
<p>Be aware, you CANNOT break out your reflection per light, the render engine doesn’t work that way. There are comp tricks using the light or spec pass to dial up or dial down your reflection per light, but as a pass, it’s all or nothing. Same goes for Refraction.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_194" style="width: 304px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure18.jpg"><img class="size-medium wp-image-194" title="figure18" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure18-294x300.jpg" alt="" width="294" height="300" /></a><p class="wp-caption-text">Figure 18. Final Composite</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once you write out your passes compositing them is pretty simple, in Nuke it’s all merge plus nodes. (Or linear burn (add) in adobe products)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_195" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure18b.jpg"><img class="size-medium wp-image-195" title="figure18b" src="http://www.disopolis.com/wordpress/wp-content/uploads/2012/02/figure18b-300x205.jpg" alt="" width="300" height="205" /></a><p class="wp-caption-text">Figure 18b. The Nuke Comp</p></div>
<p>&nbsp;</p>
<p>Here’s a quick close up of the Nuke Script</p>
<p>And that&#8217;s basic light pass/compositing with Vray.</p>
<p>&nbsp;</p>
<p><strong id="internal-source-marker_0.47385616041719913"><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.disopolis.com/wordpress/2012/vray-light-pass-script/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Part 3: Multi-Tile Shader Setup/Rendering in Maya.</title>
		<link>http://www.disopolis.com/wordpress/2011/part-3-muli-tile-shader-setuprendering-in-maya/</link>
		<comments>http://www.disopolis.com/wordpress/2011/part-3-muli-tile-shader-setuprendering-in-maya/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 00:18:44 +0000</pubDate>
		<dc:creator><![CDATA[faust]]></dc:creator>
				<category><![CDATA[CG]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Mudbox]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Vray]]></category>
		<category><![CDATA[maya multi tile displacement]]></category>
		<category><![CDATA[multi-tile]]></category>
		<category><![CDATA[multiple UV mapping]]></category>
		<category><![CDATA[Multitile]]></category>
		<category><![CDATA[multitile displacement]]></category>

		<guid isPermaLink="false">http://www.disopolis.com/wordpress/?p=135</guid>
		<description><![CDATA[Part 3: Multi-Tile Shader Setup/Rendering in Maya.  Brian Freisinger October 18, 2011 Update: June 10, 2012 &#8211; To skip directly to how to set up for displacement jump ahead to part 4 of this tutorial series. Also I&#8217;m no longer using the layered texture shader method and instead using the +/- Average node method as [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Part 3: Multi-Tile Shader Setup/Rendering in Maya.</strong></p>
<p><em> Brian Freisinger</em></p>
<p><em>October 18, 2011</em></p>
<p><strong><em>Update: June 10, 2012 &#8211; To skip directly to how to set up for displacement jump ahead to <a href="http://www.disopolis.com/wordpress/?p=211">part 4</a> of this tutorial series.</em></strong></p>
<p><strong><em>Also I&#8217;m no longer using the layered texture shader method and instead using the +/- Average node method as seen in <a href="http://www.disopolis.com/wordpress/?p=211">Part 4</a>. I&#8217;ll be updating this tutorial to reflect that in the future.</em></strong></p>
<p>&nbsp;</p>
<p>At the end of <a href="http://www.disopolis.com/wordpress/?p=102">Part 2</a> you should have ended up with an object (Cube Primitive) laid out with multi-tile UV maps, and six texture maps you extracted from Mudbox.</p>
<p>&nbsp;</p>
<p>There are now two ways you can assign your textures in a shader.</p>
<p>Again this applies to both texture and displacement mapping, but for this part of the tutorial we’ll just be looking at simple textures.</p>
<p>&nbsp;</p>
<p>Let’s start by reloading the original cube scene you should have saved and then exported to Mudbox. If you forgot, just import your cube .OBJ you used in Part 2.</p>
<p>&nbsp;</p>
<p><strong>Simple Setup:</strong></p>
<p>&nbsp;</p>
<p>The first way is the down and dirty face by face assignment. I rarely use this unless I’m in a hurry or just want to run a couple tests without setting up a shader network.</p>
<p>It’s pretty simple to set up.</p>
<p>If we’ve got six tiles, and six textures, we simply create six shaders.</p>
<div id="attachment_136" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure19_MayaPerFaceSHD_01.jpg"><img class="size-medium wp-image-136" title="figure19_MayaPerFaceSHD_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure19_MayaPerFaceSHD_01-300x258.jpg" alt="" width="300" height="258" /></a><p class="wp-caption-text">Figure 19. Shader per Face</p></div>
<p>&nbsp;</p>
<p>I’m using Vray here and creating VrayMTL shaders, but this will work the same with Lamberts, Blinns or anything else.</p>
<p>You’ll also notice I named them with a u#_v# so I can keep not only my surface assignments straight, I can also quickly identify which texture goes with which shader.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_137" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure20_MayaPerFaceAssign_01.jpg"><img class="size-medium wp-image-137" title="figure20_MayaPerFaceAssign_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure20_MayaPerFaceAssign_01-300x203.jpg" alt="" width="300" height="203" /></a><p class="wp-caption-text">Figure 20. Select each face and assign proper shader.</p></div>
<p>&nbsp;</p>
<p>Now you simply grab each UV tile in order and assign the Shader to it.</p>
<p>This can be pretty tedious, but it’s simple and fast for diagnosing texture quality, or if you just want to check a couple of displacement maps on the fly without setting up a more complex network.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_138" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure22_textureAssign_01.jpg"><img class="size-medium wp-image-138" title="figure22_textureAssign_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure22_textureAssign_01-300x281.jpg" alt="" width="300" height="281" /></a><p class="wp-caption-text">Figure 22. The correct texture tile for the correct shader.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once that’s done, it’s pretty straight forward texture assignment per shader.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_139" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure23_pngAlpha_01.jpg"><img class="size-medium wp-image-139" title="figure23_pngAlpha_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/figure23_pngAlpha_01-300x248.jpg" alt="" width="300" height="248" /></a><p class="wp-caption-text">Figure 23. Make sure there is no Transparency.</p></div>
<p>&nbsp;</p>
<p>There is one ‘gotcha’ when using .png files generated from Mudbox.</p>
<p>If you open the file in PhotoShop you’ll see it’s on ‘Layer 0’ with no background. Maya thinks that the empty background is a full alpha channel. So when it’s assigned to a shader, Maya tries to be helpful by adding a transparency or opacity channel.</p>
<p>So be aware, you either have to break the connection or lock the channel before adding the texture. I generally lock my opacity channels if I’m using this particular technique.</p>
<p>Both of these in Figure 23 have transparency added. The left is a generic Blinn, the right is a VrayMTL.</p>
<p>Double check this if you have render errors.</p>
<p>&nbsp;</p>
<div id="attachment_140" style="width: 308px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure24_simpleAssignment_Render_01.jpg"><img class="size-medium wp-image-140" title="Figure24_simpleAssignment_Render_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure24_simpleAssignment_Render_01-298x300.jpg" alt="" width="298" height="300" /></a><p class="wp-caption-text">Figure 24. Render using the simple assignment technique.</p></div>
<p>&nbsp;</p>
<p>If you wanted to add spec maps, reflection maps, bump, normal, or displacement maps, it’s the same method,  just the proper channels.</p>
<p>While this is the most simple and straight forward of setups, obviously it’s problematic for production because if you want to change Shader/Material attributes you have to make the same change to every shader, everytime. That’s why I only use this as a diagnostic tool, and not for standard production.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Master Shader:</strong></p>
<p>The second and probably best method is to use a ‘layered texture’ node connected to a master shader: Blinn, Lambert, or Vray MTL etc.</p>
<p>The reason here is obvious, you have all your tiled textures under one node for surface property control. It takes a little more time to set up, but it’s worth it.</p>
<p>If you’re not familiar with the layered texture node it’s found under “other textures” in the HyperShade.</p>
<p>Using it can be a little tricky at times, but once it’s set up it can be invaluable.</p>
<div id="attachment_142" style="width: 253px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure25_layeredTexture_01.jpg"><img class="size-medium wp-image-142" title="Figure25_layeredTexture_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure25_layeredTexture_01-243x300.jpg" alt="" width="243" height="300" /></a><p class="wp-caption-text">Figure 25. layeredTexture node</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Create a shader of your choice. For this one I’m going to use a lambert and name it “cubeMaster”</p>
<p>Create a render node under the “color” field, and assign the layered texture.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_143" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure26_layeredTextureATR_01.jpg"><img class="size-medium wp-image-143" title="Figure26_layeredTextureATR_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure26_layeredTextureATR_01-300x160.jpg" alt="" width="300" height="160" /></a><p class="wp-caption-text">Figure 26. layeredTexture Attributes</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once it’s assigned should see the layered texture attributes.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_144" style="width: 202px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure27_layeredTextureNEW_01.jpg"><img class="size-medium wp-image-144" title="Figure27_layeredTextureNEW_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure27_layeredTextureNEW_01-192x300.jpg" alt="" width="192" height="300" /></a><p class="wp-caption-text">Figure 27. Creating a new layer in the node.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Now select to the right of of the green swatch in the layered texture attribute edtor and create another node.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Just to make things simple, create four more for a total of six layers.</p>
<p>Six tiles, six layers.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_145" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure28_layerTEX_selected_01.jpg"><img class="size-medium wp-image-145" title="Figure28_layerTEX_selected_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure28_layerTEX_selected_01-300x276.jpg" alt="" width="300" height="276" /></a><p class="wp-caption-text">Figure 28. Add your tile specific texture and make sure Blend is set to &quot;Add&quot;</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Once that’s done we’ll assign our first tile to the first layer.</p>
<p>Take special node of the white boarder around what I have selected. It’s easy to mistakenly make changes to the wrong layer. Double check you see that white boarder that signifies “selected” before you make any changes or you might be doing it to the wrong layer.</p>
<p>You’ll also note in Figure 28, I highlighted the “Blend Mode”</p>
<p>It defaults with “none”, for a multi-tile texture set to work we need to set it to “add”</p>
<p>In the color field I’m assigning my first tile which is CubePaint_Tutorial_u1_v1.png</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_146" style="width: 240px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure29_layerTEX_default_01.jpg"><img class="size-medium wp-image-146" title="Figure29_layerTEX_default_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure29_layerTEX_default_01-230x300.jpg" alt="" width="230" height="300" /></a><p class="wp-caption-text">Figure 29. Set Default Color to solid black.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Because we’re using an “Add” Blend we’ll also need to set our default color to a solid black or it will contribute to the color.</p>
<p>If you forget to make this change it will start washing out your texture color until there is enough contribution to make it a solid white. It’s a very important step in the process to assure your painted textures and your rendered textures are 1:1</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_147" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure30_layerTEX_place2d_A_01.jpg"><img class="size-medium wp-image-147" title="Figure30_layerTEX_place2d_A_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure30_layerTEX_place2d_A_01-300x143.jpg" alt="" width="300" height="143" /></a><p class="wp-caption-text">Figure 30. Uncheck wrap U and wrap V. Take note of the Translate Frame fields.</p></div>
<p>&nbsp;</p>
<p>Next we’ll have to move down to the texture’s place2dTexture node and make some changes.</p>
<p>I have two areas highlighted in Figure 30.</p>
<p>The first is the translate frame. For our first tile we’ll do nothing, but this is important to take note of. It’s a bit counter intuitive to the process we’ve been using to count tiles, but the two fields of 0 and 0 basically mean u1_v1, or as it sees it zero translation in U or V. Basically it’s our first tile.</p>
<p>&nbsp;</p>
<p>Second is the wrap u and wrap v fields. They’re on by default so your textures will continue repeating in each tile to infinity. Because we have textures for each tile painted we want to turn this off or the process will fail.</p>
<p>And that’s it, the first tile is done.</p>
<div id="attachment_148" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure31_layerTex_tile2_01.jpg"><img class="size-medium wp-image-148" title="Figure31_layerTex_tile2_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure31_layerTex_tile2_01-300x287.jpg" alt="" width="300" height="287" /></a><p class="wp-caption-text">Figure 31. Keep Track of your layers.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Going back to our layered texture node, we now see tile one is blue, signifying it’s got a connection. You’ll notice the white outline around layer 2 which indicates I have it selected and am now ready to make it an “add” blend and assign the texture.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_149" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure32_layerTEX_place2d_B_01.jpg"><img class="size-medium wp-image-149" title="Figure32_layerTEX_place2d_B_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure32_layerTEX_place2d_B_01-300x287.jpg" alt="" width="300" height="287" /></a><p class="wp-caption-text">Figure 32. Translate the next texture/tile over by a full unit.</p></div>
<p>&nbsp;</p>
<p>I go through the same process, making sure my default color is black, but this time in the place2dTexture node I make one change.</p>
<p>As I pointed out in Figure 30, I left the translate frame fields at the default 0,0</p>
<p>For my second tile, which I saved as CubePaint_Tutorial_u2_v1.png, I need to change the field to<strong> translate 1 in UV x, and 0 in UV v</strong></p>
<p>This basically equals our u2_v1 tag.</p>
<p>So the next layer would have a Translate Frame of 2 for your texture u3_v1 and so on.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>When a lot of files are flying around it’s easy to make the mistake of punching in the wrong numbers for your textures, so double check that if your render looks wrong.</p>
<p>So now it’s just a matter of going through the whole process till you have a full assignment of your tiles to the shader network.</p>
<div id="attachment_150" style="width: 310px" class="wp-caption alignleft"><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure33_hypershadeRender_01.jpg"><img class="size-medium wp-image-150" title="Figure33_hypershadeRender_01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/Figure33_hypershadeRender_01-300x188.jpg" alt="" width="300" height="188" /></a><p class="wp-caption-text">Figure 33. Final Hypershade and Render.</p></div>
<p>&nbsp;</p>
<p>In the end your Hypershade should look like this, and as you can see I did a quick render to make sure it was working. I’m using a VrayMTL in this one, but as I stated it works in any of the standard Lambert, Blinn, Phong, etc shaders.</p>
<p>&nbsp;</p>
<p>From this point on I usually copy the network and start connecting it to the other channels I’m planning on using; Spec, Reflection, Bump, Displacement, or in the event of using a SSS shader, I’ll plug it into the Sub-surface color, Scatter color, etc.</p>
<p>&nbsp;</p>
<p>That’s pretty much it.</p>
<p>&nbsp;</p>
<p><a href="http://www.disopolis.com/wordpress/?p=211">Part 4, Multitile displacement mapping</a></p>
<p>&nbsp;</p>
<p><strong><em>Update: June 10, 2012 &#8211; To skip directly to how to set up for displacement jump ahead to <a href="http://www.disopolis.com/wordpress/?p=211">part 4</a> of this tutorial series.</em></strong></p>
<p><strong><em>Also I&#8217;m no longer using the layered texture shader method and instead using the +/- Average node method as seen in <a href="http://www.disopolis.com/wordpress/?p=211">Part 4</a>. I&#8217;ll be updating this tutorial to reflect that in the future.</em></strong></p>
<p>&nbsp;</p>
<p><span style="color: #ffffff;"> Tags: CG, Vray, multiple UV, multiTile, multi-tile, UV mapping</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.disopolis.com/wordpress/2011/part-3-muli-tile-shader-setuprendering-in-maya/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vray &#8211; Mass SubDivision Surface Flag for Maya</title>
		<link>http://www.disopolis.com/wordpress/2011/vray-mass-subdivision-surface-flag-for-maya/</link>
		<comments>http://www.disopolis.com/wordpress/2011/vray-mass-subdivision-surface-flag-for-maya/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 00:33:43 +0000</pubDate>
		<dc:creator><![CDATA[faust]]></dc:creator>
				<category><![CDATA[CG]]></category>
		<category><![CDATA[Maya]]></category>
		<category><![CDATA[Vray]]></category>
		<category><![CDATA[subdivision surface]]></category>

		<guid isPermaLink="false">http://www.disopolis.com/wordpress/?p=30</guid>
		<description><![CDATA[&#160; &#160; &#160; &#160; When you have a lot of objects in a scene and you want to utilize Vray&#8217;s subdivision flag, it can be time consuming to go through the whole lot and flag each one by one. So here&#8217;s a quick mel script to help out. Select all your objects you want flagged as Subdiv [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/vray_for_maya_logo.png"><img class="alignleft size-medium wp-image-32" title="vray_for_maya_logo" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/vray_for_maya_logo-300x200.png" alt="" width="180" height="120" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>When you have a lot of objects in a scene and you want to utilize Vray&#8217;s subdivision flag, it can be time consuming to go through the whole lot and flag each one by one.</p>
<p>So here&#8217;s a quick mel script to help out.</p>
<p>Select all your objects you want flagged as Subdiv and then run this in the script editor:</p>
<p>&nbsp;</p>
<div>
<p>$selected = `ls -sl -l`;</p>
<p>&nbsp;</p>
<p>for ($i=0;$i &lt; size($selected);$i++)</p>
<p>{</p>
<p>$selShape = `listRelatives -shapes $selected[$i]`;</p>
<p>$selFullPath = ($selected[$i]+&#8221;|&#8221;+$selShape[<wbr>0]);</wbr></p>
<p>vrayAddAttr $selFullPath vraySubdivEnable;vrayAddAttr $selFullPath vraySubdivUVsAtBorders;<wbr>vrayAddAttr $selFullPath vraySubdivUVs;</wbr></p>
<p>//print ($selFullPath+&#8221;\n&#8221;);</p>
<p>}</p>
<p><span style="color: #993300;"><em> (Update/Edit : If you find the code throwing you an error like this:</em></span></p>
<p><span style="color: #993300;"><em>// Error: $selFullPath = ($selected[$i]+”|”+$selShape[0]);</em></span></p>
<p><span style="color: #993300;"><em>//</em></span></p>
<p><span style="color: #993300;"><em>// Error: Syntax error // </em></span></p>
<p><span style="color: #993300;"><em>You need to change the quote marks ( ”|” ) </em></span></p>
<p><span style="color: #993300;"><em>Just select them and retype. You can thank wordpress text formatting for that.)</em></span></p>
<p>&nbsp;</p>
<p>You can then set your globals subdiv to be lower (like 6 instead of 256) and flag the important ones to be higher if needed.</p>
<p>There isn&#8217;t a good rule of thumb for how much to subD. It&#8217;s based a lot on how close you get to camera and how dense the geo was to start with.</p>
<p>In the event you&#8217;re using a displacement map, you&#8217;ll want to push this up higher. I find somewhere around the 40-50 gets me where I need  to be without breaking my rendering bank. Again, in the event I need to scrap the paint via camera move I may start pushing this up.  I will however say, I&#8217;ve found that a lot of  &#8221;my renders are really slow&#8221; come from people flagging the subD on their models and leaving it at default. Again, if 90% of my scene needs a 4-6 subD, I&#8217;ll go into the other 10% and give it an override flag, bringing it up to the minimum level to look good.</p>
<p>&nbsp;</p>
<p><a href="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/vraySubDGlobal01.jpg"><img class="alignleft size-medium wp-image-34" title="vraySubDGlobal01" src="http://www.disopolis.com/wordpress/wp-content/uploads/2011/10/vraySubDGlobal01-300x233.jpg" alt="" width="300" height="233" /></a></p>
<p>&nbsp;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.disopolis.com/wordpress/2011/vray-mass-subdivision-surface-flag-for-maya/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
