{"id":117,"date":"2011-10-26T19:05:02","date_gmt":"2011-10-27T02:05:02","guid":{"rendered":"http:\/\/www.toadstorm.com\/blog\/?p=117"},"modified":"2011-10-27T10:26:55","modified_gmt":"2011-10-27T17:26:55","slug":"creating-a-uv-pass-for-use-in-post","status":"publish","type":"post","link":"https:\/\/www.toadstorm.com\/blog\/?p=117","title":{"rendered":"creating a UV pass for use in post"},"content":{"rendered":"<p>A lot of After Effects compositors like to use a plugin to allow texture substitution on objects, called Re:Map. You render out a special color pass from your 3D scene, and then the plugin uses those colors to wrap a flat image onto the object, basically allowing you to re-texture in post.<\/p>\n<p>A lot of people in the past have asked me or others to find the material you&#8217;re supposed to use to render this pass from Maya. There are different ways to make it, but by far the easiest is to just use a place2dTexture node and a surface shader (or a VrayLightMtl, if that&#8217;s your thing).<\/p>\n<p>Connect the place2dTexture.outU &#8211;&gt; surfaceShader.outColorR. Then connect place2dTexture.outV &#8211;&gt; surfaceShader.outColorG.<\/p>\n<p>That&#8217;s it. Apply the material to everything and you&#8217;re done. In VRay, you don&#8217;t even need a material if you want to save a render layer; just create a VrayExtraTex element on your render layer and connect the place2dTexture outputs to the ExtraTex element in the same manner.<\/p>\n<p>The setup is really easy but there are a few things to watch out for. First of all, if your UV&#8217;s are distorted, then any texture you place on it is going to be distorted. So you need good UV&#8217;s. If you&#8217;re using simple rectangular billboards, make sure the UV&#8217;s are normalized (you can normalize UV&#8217;s in the UV Texture Editor). Also, the image quality will suffer if you aren&#8217;t rendering to a floating point file format&#8211; 32-bit floating point images are best to avoid artifacting.<\/p>\n<p>One other subtle thing to watch out for. If you are using a linear workflow when you render (and you should be!) it&#8217;s easy to screw up this render and end up with weirdly warped images. This render should NOT be gamma-corrected in any way, so disable your lens shaders if you&#8217;re in mental ray, and set your gamma to 1.0 and turn off &#8220;linear workflow&#8221; if you&#8217;re in VRay. It&#8217;s hard to see, but take a look at the difference between a linear render of this pass and an sRGB (gamma 2.2) render:<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-117 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.toadstorm.com\/blog\/?attachment_id=118'><img width=\"150\" height=\"150\" src=\"https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_linear-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_linear-150x150.jpg 150w, https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_linear.jpg 240w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.toadstorm.com\/blog\/?attachment_id=119'><img width=\"150\" height=\"150\" src=\"https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_srgb-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_srgb-150x150.jpg 150w, https:\/\/www.toadstorm.com\/blog\/wp-content\/uploads\/2011\/10\/uv_srgb.jpg 240w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/dt><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n\n<p>The image on the left is the correct one. Using a color-corrected UV pass will cause your substituted textures in After Effects to appear very warped around certain edges.<\/p>\n<p><span style=\"color: #808080;\">(I&#8217;ve made this mistake way too many times.)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A lot of After Effects compositors like to use a plugin to allow texture substitution on objects, called Re:Map. You render out a special color pass from your 3D scene, and then the plugin uses those colors to wrap a flat image onto the object, basically allowing you to re-texture [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,19,1],"tags":[25],"_links":{"self":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/117"}],"collection":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":4,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.toadstorm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}