tag:blogger.com,1999:blog-78117792718488490092024-03-05T07:24:56.783-08:00MaterialismAdventures in the hypershade...Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-7811779271848849009.post-605873533037565152014-10-12T02:44:00.000-07:002015-07-25T02:26:17.943-07:00Previewing a new Material Presets Manager for mGo! - The Materialiser<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="//player.vimeo.com/video/108676515" webkitallowfullscreen="" width="500"></iframe> </div>
<div style="text-align: center;">
<a href="http://vimeo.com/86205127"><i><span style="color: white; font-size: x-small;">Create a golden head, just like that</span></i></a></div>
<br />
<br />
It's been too long between updates. Things have been really busy lately and I've needed some rest, but I'm at the point where I'm ready to jump into it again. Looking over the blog I realize it's deviated a bit from the original intention- which was talking about materials and shading networks and building up a resource of techniques- and has instead become a kind of dev blog for the couple of python projects I am involved with. I'm not sure what to do about that just yet.<br />
<br />
Today though, I will atleast try to merge those two things by previewing a new feature to mGo!, which I've dubbed 'The Materialiser'. This new functionality will allow you to save and load material presets from inside Mari, and of course is designed to work with <a href="http://netocg.blogspot.com.tr/" target="_blank">Antonio's</a> production based OpenGl shaders. When importing a preset, the script will read the shader type and from there a new shader will be created and every attribute set. In this way you can quickly get up and running with materials in Mari by having quick and easy access to these presets. When saving, you'll be able to sort your custom materials within categories, based on shader type or whatever you wish, and we'll include a bunch of presets with the release.<br />
<br />
A feature which could potentially really help Mari artists is an RGB values to New Channel feature, which I've been trialing the past couple of days. This would take any attributes in the material preset which were represented as RGB values, eg- the specular colour of a gold material or the gloss value for a matt plastic, and recreate those values inside new channels by adding a constant colour layer inside of them. From there, the new layer would serve as a reference or guide - you'd have a base colour or greyscale value to work from as you built up textural variety around those values. It seems like this would be quite useful.<br />
<br />
While I'm working on this stuff, Antonio is putting the finishing touches on a new system which will allow blended shader and falloff shader support in mGo! We'll transfer this system over to the Materialiser soon, so you'll be able to easily load up a 'carpaint with decals' blended shader preset if you wanted- and output the whole network directly to Maya once textured. Lots of interesting potential there.<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com3tag:blogger.com,1999:blog-7811779271848849009.post-39984499452499219512014-04-08T02:20:00.001-07:002014-04-08T08:52:29.861-07:00Mari Custom Shaders Project Update<div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXrdzajgdOpxvasE6qSpJajQiGAzkWwS0xXCZ9gpibnTauy4-5w3vAQpB_BUiwmDdRb8crKXebGzWijkODeg-fI7_CjlHDphjXxapxmBiivlrbUxsmobDMBLfKKgbjjNnNSDqo5coXTEHZ/s1600/mgo.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXrdzajgdOpxvasE6qSpJajQiGAzkWwS0xXCZ9gpibnTauy4-5w3vAQpB_BUiwmDdRb8crKXebGzWijkODeg-fI7_CjlHDphjXxapxmBiivlrbUxsmobDMBLfKKgbjjNnNSDqo5coXTEHZ/s1600/mgo.jpg" height="117" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>mGo! Exporter</i></td></tr>
</tbody></table>
<div style="text-align: center;">
<br /></div>
We've recieved a lot of great feedback from Mari users about the Custom Shaders project. If you haven't caught up on the latest videos, Antonio has posted to Vimeo some demonstrations <a href="http://vimeo.com/91053166" target="_blank"><i>here</i></a>, <a href="http://vimeo.com/91247895" target="_blank"><i>here</i></a>, and <a href="http://vimeo.com/91359990" target="_blank"><i>here</i></a>. Needless to say, we'll be pushing things further with new ideas- we're passionate about the project and are looking forward to seeing things evolve. <br />
<br />
For now, I'd just like to go through a couple current features of the exporter, which haven't been covered in the videos. First to mention is that the exporter supports shader connections to Maya linked to multiple objects. So for example- if you have a head object, and then some eyes as a separate object in Mari, you can export textures and shader attributes for the head, and then the eyes, and update those shaders and textures specific to each of those objects whenever you want in a back and forth manner.<br />
<br />
Second (and this is obviously a small feature) is the texture filter options menu in the Mari exporter UI. This lets you select amongst a small set of options related to the filter settings in Maya's filenode. The default setting 'Quadratic' blurs textures heavily and it's a pet peeve of mine to always go into that setting and turn filtering to 'Off'. 'Quadratic' and 'Off' plus another option, 'Animation' (Quadratic filtering with a reduced filter of .1 from the default 1) are the three available choices for now.<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-22375842153168524652014-02-11T12:58:00.000-08:002014-10-12T03:05:40.175-07:00Preview of 'Mari Go!' - And some Good News about LookDev in Mari<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="//player.vimeo.com/video/86205127" webkitallowfullscreen="" width="500"></iframe> </div>
<div style="text-align: center;">
<a href="http://vimeo.com/86205127"><i><span style="color: white; font-size: x-small;">Preview of 'Mari Go!'</span></i></a></div>
<br />
<br />
The Mari to Maya bridge is coming along and recently there have been some exciting developments which have impacted the project in a positive way, allowing it to be a much more useful tool than I'd originally planned. It's now being integrated into a larger project with a bigger vision- the central idea or tool being the development of some fantastic new custom shaders for Mari. These shaders are being designed (by <a href="http://netocg.blogspot.com.tr/" target="_blank">Antonio Neto</a>, <a href="http://www.digiteck3d.com/" target="_blank">Miguel A Santiago Jr</a> and <a href="http://nbreslow.com/nbmaritools" target="_blank">Nicholas Breslow</a>) as accurate representations of existing architectural/monolithic shaders used in various 3d renderers, such as Arnold, Vray and Mental Ray, and will allow artists working in Mari to get a much better sense of how their texture maps are going to look in render.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw2dgOo-RLuotLB-gKssnr4QTFgduMtmsx3LZuqQwklkTjw53hIyL2iJrtM939pHIYVWiOAJWcfw6zUy4ALsqXeKYlZkXCDUGXqWoF2bTzvpYhNlq-PrE13eCl5ACqhL7t2Yp8538e8nvd/s1600/architectural_Gold.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw2dgOo-RLuotLB-gKssnr4QTFgduMtmsx3LZuqQwklkTjw53hIyL2iJrtM939pHIYVWiOAJWcfw6zUy4ALsqXeKYlZkXCDUGXqWoF2bTzvpYhNlq-PrE13eCl5ACqhL7t2Yp8538e8nvd/s1600/architectural_Gold.png" height="178" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>mia_material replicated in Mari (by Nicholas Breslow)</i></td></tr>
</tbody></table>
<br />
<br />
Once the user is happy with how things are looking inside Mari, all textures and shader parameters set within the custom shader will translate 1:1 over to Maya/Softimage, enabling a very quick and simple way to get texture assets out of Mari and into your 3d package, ready for a test render.<br />
<br />
Check out the 'Mari Custom Shaders' project on the Paintmore forum, <a href="http://www.paintmore.co.uk/viewtopic.php?f=12&t=1356">here</a>.<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-48277864044027412082013-12-29T00:00:00.000-08:002014-01-02T17:25:38.801-08:00Creating a 'Gummi' type Thickness Shader (Part 1)<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="background-color: black; font-family: Cousine; font-size: 12px; line-height: 16px;"><span style="color: white;">POST UPDATED 31/12/2013 - INCLUDES SETTINGS FOR MENTAL RAY MIA_MATERIAL</span></b><br />
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="391" mozallowfullscreen="" src="//player.vimeo.com/video/83084375" webkitallowfullscreen="" width="500"></iframe></div>
<div style="text-align: center;">
<i><span style="font-size: xx-small;">Thickness pass (values inverted from render) - Mental Ray</span></i></div>
<div style="text-align: center;">
<br /></div>
<br />
Some time ago I figured out it's possible to make a serviceable 'thickness' or 'gummi' type compositing/utility shader in Vray using the Vray Mtl and it's 'Fog' parameter. At my current workplace we've used in the past a 3rd party shader from Binary Alchemy (the RayLength shader I believe), in order to compliment subsurface scattering at the compositing stage via a thickness pass. This was explained to me by my boss at the time as a dirty trick, which nevertheless had the desired effect of making our CG food look more 'foodlike' and appetising. It's a strange but potentially useful technique, which I'll cover in a later post. For now let's just focus on making the shader. The basic idea is also translatable to a MR mia_material version, using the 'Max Distance' instead of the Vray 'Fog' parameters.<br />
<br />
Basically, a thickness shader is one which is able to approximate the interior thickness of an object. A thickness pass would describe in greyscale values the relative thickness of something, ie- whiter pixels representing thicker areas and darker pixels thinner areas. As you can see in the video above, the dragon's tail, tip of the tongue, horns etc, are all darker in colour while the belly, legs and head are the thickest, lightest areas. When setting up the shader, we will need to invert these values however, and then re-invert back in our compositing package later on.<br />
<br />
Setting up the shader/pass...<br />
<br />
<br />
<a name='more'></a><br />
<br />
<h4 style="text-align: left;">
<span style="color: cyan;">In Vray -</span></h4>
<br />
Create a new domelight, check the 'spherical' box, and leave the rest of the options at default. This provides a nice, over all lighting for the scene on a white background. Apply a new Vray Mtl material to your object. Now let's dial in some settings-<br />
<br />
<br />
Diffuse Color - (0 -black) We don't want any diffuse.<br />
<br />
Reflection Color - (0 -black) We don't want any reflection.<br />
<br />
Refraction Color - (1 -white) The object should be completely refractive/transparent.<br />
<br />
Refraction Glossiness - (.5 or lower). This smooths out the interior refractions, making them very glossy and giving the object a gummy, or jellylike look. It's important to blur out any interior details so I'd probably advise .5 as a starting point and then push the blurriness as far as you are willing to go. Don't forget to increase the refraction subdivs up to get rid of the increased noise.<br />
<br />
Refraction IOR - (1) We don't want any light bending as it passes through the object. Setting the IOR to 1 ensures the light travels through the object in a straight line.<br />
<br />
Fog Color - (.05 -very dark grey). This parameter is the reason for rendering the pass inverted (dark object on white background). I don't think it's possible to do it the other way around (light object on black bg).<br />
<br />
Fog Multiplier - This value will change depending on your object scale and thickness, and should decrease as the scale of the object increases. For an object roughly the length of 20 maya units, a rough starting point might be a value of around .2. If you halve the scale of your object, try upping the Multiplier to .4. Basically, you want a good range between the lights and darks, but not too contrasted. Fog bias should be left at default.<br />
<br />
We're not interested in bump, anisotropy or sss settings- leave those at default.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht2jcy2p0iJrhlC9SvMdtNHOE2A-haCBvRqkMX322W5cuyJKOVbT93gNcaSrZlsgGjS6Cw3KtvKqsgX7jWCwnnWbnO5hh8Yhh6RIUnRlr-5VHH4QYnfRBAH4d617119wIt_LSnCXB0KYvP/s1600/settings.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht2jcy2p0iJrhlC9SvMdtNHOE2A-haCBvRqkMX322W5cuyJKOVbT93gNcaSrZlsgGjS6Cw3KtvKqsgX7jWCwnnWbnO5hh8Yhh6RIUnRlr-5VHH4QYnfRBAH4d617119wIt_LSnCXB0KYvP/s1600/settings.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Basic Vray Mtl settings for a thickness shader</i></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2zONolwU1CdngA5SU6qmSNAlK3ZlcHGI7FulBU41ikhyphenhyphenmubUvxfhree9nvkLxnGcGbZQB1k1VOeiDNcyTSsEvmdZELM71s2sWQjNo9D_dNy9-dV98io2GvLMpDTDjT4FNU2OlzPoJEMq/s1600/thick+dragonn_white.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg2zONolwU1CdngA5SU6qmSNAlK3ZlcHGI7FulBU41ikhyphenhyphenmubUvxfhree9nvkLxnGcGbZQB1k1VOeiDNcyTSsEvmdZELM71s2sWQjNo9D_dNy9-dV98io2GvLMpDTDjT4FNU2OlzPoJEMq/s320/thick+dragonn_white.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Reference/Result</i></td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<h4 style="text-align: left;">
<span style="color: cyan;">In Mental Ray -</span></h4>
<div>
<span style="color: cyan;"><br /></span></div>
The settings for a mia_material version are very similar to the Vray one...<br />
<br />
Color - (0 - Black)<br />
Reflectivity - (0)<br />
Index of Refraction - (1)<br />
Transparency (under refraction tab) - (1)<br />
Glossiness - (.3) (reduce noise by increasing glossy samples)<br />
<br />
Under Advanced Refraction tab-<br />
<br />
Check 'Use Max Distance'<br />
Max Distance (6? - Adjust to preference, using reference image above as guide)<br />
Check 'Use color at Max Distance'<br />
Color at Max Distance (very dark grey)<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiayvRCz-WD8gWt5YfUsbwmLCpDyHUj8lJOAkdXPOfbuqTuJl_XeL6YL5-F4pxtrx03JpNCA0ka_MAHAPdhhrj9gnkBOEDqtSSEKoTqvztZWN2am-aG710R5iTkViOJfl62gAp8z9TSFweN/s1600/gummiMR.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiayvRCz-WD8gWt5YfUsbwmLCpDyHUj8lJOAkdXPOfbuqTuJl_XeL6YL5-F4pxtrx03JpNCA0ka_MAHAPdhhrj9gnkBOEDqtSSEKoTqvztZWN2am-aG710R5iTkViOJfl62gAp8z9TSFweN/s1600/gummiMR.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>settings for mia_material</i></td></tr>
</tbody></table>
<br />
<br />
In Part 2 we'll head over to Nuke and talk a bit about how we might use a thickness pass to enhance the look of SSS materials. See you then :)<br />
<br />
<span style="background-color: #f9f9f9; font-family: verdana, arial, sans-serif; font-size: 11px;"></span>
<span style="background-color: #f9f9f9; font-family: verdana, arial, sans-serif; font-size: 11px;"></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com3tag:blogger.com,1999:blog-7811779271848849009.post-49271777016570889172013-12-28T13:18:00.000-08:002013-12-28T14:30:49.387-08:00Create your own XSI styled Maya Viewport Render Tool<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
One Softimage feature which I've felt was sorely lacking in Maya (apart from ICE of course) is the awesome interactive viewport renderer. This thing is super functional- you can quickly via shortcut make a little region render in full persp view to see how one little aspect of your scene is looking, or drag a rectangle over everything for a full render without needing to open up the render view and close it back down again. The benefit is that it doesn't interrupt you by taking you out of your normal working view. Going back to Maya and dealing with the render view panel feels really unintegrated and clumsy by comparison.<br />
<br />
So how happy was I when I saw that someone over at <a href="http://therenderblog.com/maya-viewport-render/" target="_blank">Therenderblog</a> has developed a Softimage style viewport render tool for Maya, which theoretically will work with any renderer of your choice and will help educate you about scripting Python tools in Maya to boot?<br />
<br />
Pretty happy.<br />
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="283" mozallowfullscreen="" src="//player.vimeo.com/video/82524686" webkitallowfullscreen="" width="500"></iframe> </div>
<div style="text-align: center;">
<br /></div>
</div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-14055484827868542342013-12-14T03:08:00.000-08:002013-12-28T16:35:08.966-08:00Thinking 'bout Mari<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhks2UCr9ROwgJR1AvzmLPfNunRPuhZEGY4pPiLmdzrIDsJ-pIc76aoPybu7P-C26RX1wZGYznf7ejQcknfa9H504r3-o3dnkacYlIcsCICJeNvEV-CjmSJQz9g_oWgm4h3GqrtuH2W1kiC/s1600/Mariya+concept2.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhks2UCr9ROwgJR1AvzmLPfNunRPuhZEGY4pPiLmdzrIDsJ-pIc76aoPybu7P-C26RX1wZGYznf7ejQcknfa9H504r3-o3dnkacYlIcsCICJeNvEV-CjmSJQz9g_oWgm4h3GqrtuH2W1kiC/s320/Mariya+concept2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Mariya/Gomaya design concept. <br />There has to be a better name for this thing</i></td></tr>
</tbody></table>
<br />
This is currently just concepting an idea. I've been inspired recently by Dave Girard's <a href="http://polygonspixelsandpaint.tumblr.com/post/69490455615" target="_blank">Mari Me</a> script for Maya- I thought it might be fun to see how Python works in Mari and started wondering about a Texture Robot type script which works across Mari and Maya, sending out the locations of flattened channels to Maya to be hooked into shading networks, a la Texture Robot.<br />
<br />
It looks a lot like Texture Robot right now. The main design difference is in linking the various shader inputs to existing Mari channels, rather than filenames in a directory. Again, you'd select the shader type appropriate to the renderer you're using. UDIM support will need to be a feature.<br />
<br />
Early days.<br />
<br />
<br />
<br />
<br />
update:<br />
<br />
<a name='more'></a><br />
<br />
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPk1sxAxtKq2bZwn_2qC0gLlAz5k59Jol1Ykw3qonePb4whnDaXFA8EQdhwL9PF4-Pj0YXADc7y9WHEjnvZrGac63VSpkl67psH3Ix_wF5LJBZH-zxG5lsMGmd20Ik7AvvVHKv-k_rxJUr/s1600/goMaya2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPk1sxAxtKq2bZwn_2qC0gLlAz5k59Jol1Ykw3qonePb4whnDaXFA8EQdhwL9PF4-Pj0YXADc7y9WHEjnvZrGac63VSpkl67psH3Ix_wF5LJBZH-zxG5lsMGmd20Ik7AvvVHKv-k_rxJUr/s400/goMaya2.jpg" width="363" /></a></div>
<br />
Ok- I have a basic palette style UI working inside Mari. Looking at things a little more closely, it seems it'll be a lot better for the user to be able to simply select an existing Mari shader, which already has channels assigned to the various inputs, than recreate and double up on that stuff with new menus. That streamlines things a great deal... select a folder, a Mari shader, and a Maya import shader (mia_mat_x, Vray Mtl, etc), and you're pretty much ready to go.<br />
<br />
I like the way this is heading :)<br />
<br /></div>
</div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-87611661350515382442013-06-18T15:48:00.000-07:002013-12-15T10:20:58.152-08:00Texture Robot - Version 1.2.0 <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcJI1x3MP7XFovp6gAR3NRCOk_YxF-OKNoGa0kfhgo-Bv9t33-sTRLk5uIkaNlSPJjPzjOM9eYynPXxXV_TiQqTE11mf-IzgrdmgQEeRb7b2GVb7qALG5MetakC5ab9tUR4HXhSUklFIhY/s1600/1200_ui3.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcJI1x3MP7XFovp6gAR3NRCOk_YxF-OKNoGa0kfhgo-Bv9t33-sTRLk5uIkaNlSPJjPzjOM9eYynPXxXV_TiQqTE11mf-IzgrdmgQEeRb7b2GVb7qALG5MetakC5ab9tUR4HXhSUklFIhY/s1600/1200_ui3.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>TR - 1200</i></td></tr>
</tbody></table>
<br />
<br />
I wanted to get a new version of TR out before going overseas, so here it is. The main new feature is a store current config button (top left), which will save you from having to re set things up the way you like them everytime the script is run. The configuration file stores all the suffixes, file extensions, checkbox options and currently selected shader type.<br />
<br />
Another new addition is Ptex support (currently only available with mia_mat and Blinn in TR as I ran out of time for Vray. Arnold doesn't support Ptex in Maya yet). Ptex is not a file format I'm very familiar with, but I thought I should address it as you can't load in ptextures with normal file nodes while using MR or Vray, you need to use special nodes specific to each renderer. Ptex <i>does</i> work with normal file nodes in Viewport 2.0 however, so the Blinn shader option in TR goes that route.<br />
<br />
The icing on the cake is a somewhat nice-a-fied UI, with a new info bar at the top of the window for displaying messages.<br />
<br />
Oh, and emissive textures now actually go where they're supposed to. <i> (golf clap...)</i><br />
<br />
Creative Crash <a href="http://www.creativecrash.com/maya/script/texture-robot" target="_blank">has it</a>.<br />
<a href="http://materialism-blog.blogspot.com/2013/05/texture-robot-home.html" target="_blank">Changelog</a><br />
<br />
update: version 1.3 available. Fixes bugs, adds stuff<br />
<a href="http://www.creativecrash.com/maya/script/texture-robot">http://www.creativecrash.com/maya/script/texture-robot</a><br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-586823536104713062013-06-12T12:44:00.002-07:002013-06-18T01:33:55.206-07:00Texture Robot updated to Version 1.1.0<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<br /></div>
<div>
Just a quick note to say that the Texture Robot script for Maya has moved up the chain to version 1.1.0. I'm getting closer to implementing all of the features I'd originally planned for it, including support for various renderers (Arnold, Vray) via the aiStandard material and the Vray Mtl. There's also support for Maya's blinn, which is useful in a viewport 2.0 viewport environment as you're able to display more types of texture map (including bump and specular) than the other materials. I've been using it a lot lately for quick previews and it works great. Of course, it's nothing compared to what you can do with the new Dx11 shader, which I'll hopefully get around to doing something about for games people in a later version.<br />
<br />
There's also been a few added texture slots- Transparency, Cutout Opacity, and Emissive (self illumination/incandescence). I think this covers the most widely used types of texture map that people regularly use. There's SSS to deal with, but again, that's for the future, hopefully not to distant.<br />
<br />
The last thing I want to mention is the added 'tooltip' descriptions as you hover over parts of the UI. Most of them just describe the thing itself (browse Texture Directory icon for instance), but if you hover over the texture slot labels on the left hand side, you will get a little message showing you where the texture slot connects into the various shader's parameters. For eg, hovering over the 'Spec Gloss' label will bring up the following:<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQcFAicEuHnOWcoupeoQMz7LC82m1iYHy_R2Ag5o2Y8qLa6RwZ5sEq8CxF1Nb1jfT_7jx47zOenqBIyYYFWQT7X5oTM3kuNJzc-JaoWLqpT9rTqY-gQaFoIcPx-mdaV5CbbiRZBXaiTIYV/s1600/specgloss.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQcFAicEuHnOWcoupeoQMz7LC82m1iYHy_R2Ag5o2Y8qLa6RwZ5sEq8CxF1Nb1jfT_7jx47zOenqBIyYYFWQT7X5oTM3kuNJzc-JaoWLqpT9rTqY-gQaFoIcPx-mdaV5CbbiRZBXaiTIYV/s1600/specgloss.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>TR- now with tooltips. Goody</i></td></tr>
</tbody></table>
<br />
<br />
So this is just a way to understand the different terminology across shaders, how the parameters relate to each other and hopefully it can help to clear up any confusion about where each texture slot is going. I used pretty standard names for each slot (specular instead of reflection, as I don't think anybody refers to a specular map as a reflection map, but I could be dead wrong) but just in case, these tooltips are there.<br />
<br />
Next feature I'll be working on is a button to save out A custom setup within TR. That means, if you don't like the suffix 'd' for diffuse, but prefer 'c' for colour or something else, you can save your custom suffixes and next time you run the script, it will load your preferences. It should also save out the shader type, file extensions and the other various options. That would be pretty handy I think.<br />
<br />
You can get the latest version of Texture Robot <a href="http://www.creativecrash.com/maya/script/texture-robot" target="_blank">here</a>.<br />
<br />
<a href="http://materialism-blog.blogspot.com/2013/05/texture-robot-home.html" target="_blank">Full Changelog</a>.<br />
<br />
<br /></div>
</div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-61800301993978583602013-05-31T15:49:00.000-07:002013-07-28T14:05:25.748-07:00Texture Robot - Home<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiALLDXkYlgGPI-5tDGr6dkgtYdLHVPk4Nbdu-jXYa5CT0awKrLRXj7PEQfkup1QrIaD3-VdKD38EAhOBGm6eO_I8p-j4kpfLOO3a9kDHmyLP6ShJEJ9fH7ju6xGapxTXrLnHzCV9bHb4Lg/s1600/help2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiALLDXkYlgGPI-5tDGr6dkgtYdLHVPk4Nbdu-jXYa5CT0awKrLRXj7PEQfkup1QrIaD3-VdKD38EAhOBGm6eO_I8p-j4kpfLOO3a9kDHmyLP6ShJEJ9fH7ju6xGapxTXrLnHzCV9bHb4Lg/s1600/help2.jpg" /></a></div>
<h3 style="text-align: center;">
</h3>
<h3 style="text-align: center;">
<a href="http://www.creativecrash.com/maya/script/texture-robot" target="_blank">DOWNLOAD LINK</a><span style="color: #3d85c6;"> (ver 1.3.0 - July 27th, 2013)</span></h3>
<div>
<span style="color: #3d85c6;"><br /></span>
<span style="color: #3d85c6;"><br /></span></div>
<div>
<span style="color: cyan;">Version 1.3.0 (July 27, 2013)</span><br />
<br />
<span style="font-size: x-small;">* Added Ptex support for Vray material</span><br />
<span style="font-size: x-small;">* Added insert Gamma Nodes option for Linear Workflows (mia_mat and Vray Mtl)</span><br />
<span style="font-size: x-small;">* Bug fix- Some Vray textures failed to assign to file nodes in previous version of TR</span><br />
<span style="font-size: x-small;">* Bug fix- The 'create shading network' button lit up green and "textures found" message displayed only if a diffuse file texture was found</span><br />
<span style="font-size: x-small;">* Bug fix- Misnamed icon filename</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="color: cyan;">Version 1.2.1 (June 23, 2013)</span></div>
<div>
<br />
<span style="font-size: x-small;">* Bug Fix- # UnboundLocalError: local variable 'file_node4' referenced before assignment # </span></div>
<br />
<span style="color: cyan;">Version 1.2.0 (June 22, 2013)</span><br />
<span style="color: cyan;"><br /></span><span style="font-size: x-small;">
* Added Store Config and Toggle Hypershade Buttons (top left)</span><br />
<span style="font-size: x-small;">* Added support for Ptex (mia_material_X and Blinn).</span><br />
<span style="font-size: x-small;">* For Ptex in MR, maya.rayrc file created in maya/prefs folder if it doesn't already exist (rendering will require Maya restart)</span><br />
<span style="font-size: x-small;">* UI Improvements - nicer button graphic, found textures highlit in green, info display window, new shelf icon</span><br />
<span style="font-size: x-small;">* Bug fix- Specular Gloss overwrote Emissive texture slot</span><br />
<span style="font-size: x-small;">* Bug fix- When creating a Blinn shader, script tries to delete node before it exists</span><br />
<span style="font-size: x-small;">* Bug fix- Script editor gives error @ Create Network if hypershade isn't open</span><span style="color: cyan;"><br /></span>
<span style="color: cyan;"><br /></span>
<span style="color: cyan;">Version 1.1.0 (June 10, 2013)</span><br />
<br />
<span style="font-size: x-small;">* Added support for Vray and Arnold renderers with Vray_Mtl and aiStandard material shaders</span><br />
<span style="font-size: x-small;">* Added support for Maya Blinn (useful for viewport 2.0 texture map previews)</span><br />
<span style="font-size: x-small;">* Added option for creating Place2D Texture nodes before file texture nodes</span><br />
<span style="font-size: x-small;">* Added transparency, cutout opacity and emissive (self illumination) texture slots</span><br />
<span style="font-size: x-small;">* Added 'tooltip' annotations to many UI elements</span><br />
<span style="font-size: x-small;">* Added support for vector displacement with 'vector space options' menu</span><br />
<span style="font-size: x-small;">* Set attribute 'Alpha is Luminance' to On for all file textures (when might someone specifically <i><span style="color: cyan;">not</span></i> want that? <a href="mailto:stutozer@gmail.com" target="_blank">Email me</a>!)</span><br />
<br />
<span style="color: cyan;">Version 1.0.1 (May 25th 2013)</span><br />
<br />
<span style="font-size: x-small;">* Fixed bug on Mental Ray plugin load</span><br />
<span style="font-size: x-small;">* Redirected Texture Robot 'Home' icon button to this page</span><br />
<br />
<span style="color: cyan;">Version 1.0.0 (May 2013)</span><br />
<br />
<span style="font-size: x-small;">* Initial Release version </span><br />
<span style="font-size: x-small;"><br /></span>
<br />
<br />
<span style="color: cyan;">Noted Bugs / Rough Edges</span><br />
<span style="color: cyan;"><br /></span>
<div>
* Once in a while I've noticed the Object list stops showing objects. This is fixed by closing Texture Robot, and reopening it. I'm not sure why this happens but I'm working on a proper fix. <br />
<br />
* If TR finds both a bump map file and a normal map file, it will try to hook both of them up to the network, which will result in an error. Same goes for displacement and vector displacement. A workaround for this problem while working in Maya is to temporarily change the suffix of one of the slots (the one you don't want to use) to something unrecognisable (ie, change bump from 'b' to 'x', then refresh the texture slots. A proper fix will be to code in some radio buttons which toggle between bump and normal map or displacement and vector displacement.<br />
<br />
<br />
<span style="color: cyan;">Features or possibilities planned for future versions</span><br />
<span style="color: cyan;"><br /></span>
* Update currently selected shader via filename versioning, ie- of the two files 'apple_d_v01.jpg' and 'apple_d_v02.jpg', the latter file will be selected and will overwrite the current entry in the file texture node, or create a new node if none existed.<br />
<br />
* Shader conversion (from mia_material_x to VrayMtl for eg) (? a bolt on feature, low priority)<br />
<br />
* Udim (multi UV patch) support<br />
<br />
* 'Super auto' feature - if a scene object(s) matches a name in Texture Robot's object list, the script will automatically apply the associated textures to the selected (unselected?) geometry. This could be an 'outside the UI' feature, possibly another shelf icon or hotkey, leaving the UI as a general configuration tool.<br />
<br />
* SSS layer slots for combined SSS and mia_mat etc,<br />
<br />
* Dx11 shader support<br />
<br />
* UI improvements<br />
<br />
<br />
<span style="color: cyan;">INSTRUCTIONS:</span><br />
<br />
Video coming Soon<br />
<br />
<br /></div>
</div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-88168416026263156142013-05-26T12:27:00.001-07:002013-05-30T07:55:55.659-07:00Introducing Texture Robot - Auto File Texture Assigner for Maya<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhriQZl1YH5ebjv4l3LToVwAhmY0QJQi7eYhQ9xADolW9p4wk0lfsPEw4H8x_HWRh2ZtFOpnPhEVdAMP4IRVYMi0-YNHZUnaR8fcI9F3d57NLWXYdOuZzP8tQdPvxCXcYAyzscDr-lhQOmO/s1600/introducingTextureRobot2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhriQZl1YH5ebjv4l3LToVwAhmY0QJQi7eYhQ9xADolW9p4wk0lfsPEw4H8x_HWRh2ZtFOpnPhEVdAMP4IRVYMi0-YNHZUnaR8fcI9F3d57NLWXYdOuZzP8tQdPvxCXcYAyzscDr-lhQOmO/s400/introducingTextureRobot2.jpg" width="333" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Humbly but proudly presenting 'Texture Robot'</i></td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
Today I'm pleased to announce a new tool for Maya. 'Texture Robot' represents my first foray into building Maya tools with Python and I'm surprised it works at all, but it does. This little robo does the job of automatically assigning common file textures (maps) into shading networks based on simple filename conventions.<br />
<br />
Since a video is worth a thousand pictures (at 25 fps running for 40 seconds anyway) below's a quick preview demonstration of the new script in action. Over the next week or so I'll try to find the time to create a new post here on the blog which will serve as 'Home' for Texture Robot- it'll include some proper instructions, a program changelog and updates on any planned or new features, of which I have a few in mind already.<br />
<br />
So without further ado, take it away- Texture Robot...<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/jMNRdiN0M4Q?feature=player_detailpage" width="640"></iframe><br />
<br />
<br />
Edit : the script is now online at <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/texture-robot">Creative Crash</a>.<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-48699226090166818602013-02-01T10:14:00.000-08:002013-03-02T16:02:39.539-08:00Assign MIA or VRay Materials to Objects with a Click (Or Two)<div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><div style="text-align: left;">
<b>POST UPDATED 3/3/2013</b></div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVXINpqaeHB1E7f4Z78X8CZ9JRV10T1RhTbRHwUOlp2QfHL4Uh40n_S3b8xXbelUFpsPUTAvYab9t4X-cBg2qFuSX8UmJkGfCcp9v96McL4P8JcunoVYTFEvyAJnxZQU_qiVrtaZtrIwes/s1600/shelf.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="34" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVXINpqaeHB1E7f4Z78X8CZ9JRV10T1RhTbRHwUOlp2QfHL4Uh40n_S3b8xXbelUFpsPUTAvYab9t4X-cBg2qFuSX8UmJkGfCcp9v96McL4P8JcunoVYTFEvyAJnxZQU_qiVrtaZtrIwes/s320/shelf.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="text-align: left;"><span style="font-size: x-small;"><i>Generating a custom shelf with all of your favourite Maya scripts and tools in it can help save a lot of time</i></span></span></td></tr>
</tbody></table>
<br />
<br />
Something I've thought for a while would be nice is just a little shortcut that would create a mia_material and assign it to the currently selected object automatically, without needing to go into the hypershade and hunt through shaders, or use the right click menus. The other day I noticed that if you have VRay installed, on the VRay shelf tab (it takes over the previous 'Rendering' tab) there's a shortcut item there for applying a VRay standard material to your object. If you right click on the icon and select 'edit' (taking you into the Shelf Editor) you'll see the code is pretty simple...<br />
<br />
<blockquote class="tr_bq">
<span style="color: cyan;">createAndAssignShader VRayMtl ""</span></blockquote>
<br />
From there, I was happy to discover that if you swap out 'VRayMtl' for 'mia_material_x', it creates a mia_x instead. Logical I guess... but still pretty cool.<br />
<br />
So now I have a new icon in my main custom shelf tab- whereby a single click creates and applies a standard Vray material, and double clicking applies a mia_material instead. I've also taken advantage of the 'Popup Menu Items' feature of the Shelf Editor (accessible via the far right tab) to include a few more select materials which I use constantly. <br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYrTwN66CSZNPvIqc3xR0rpywWu5-mNtDqirWWHEm25F1G37m4wDbkJEtgwbfWC-oeRzyz7C3Nv1Lpv5JpHEZe0OJfmwQawsqHYbVaWrQkAal8SbbPquN_LOFNO0MR5l2fISvJUS9pP1Yz/s1600/shelf+editor.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYrTwN66CSZNPvIqc3xR0rpywWu5-mNtDqirWWHEm25F1G37m4wDbkJEtgwbfWC-oeRzyz7C3Nv1Lpv5JpHEZe0OJfmwQawsqHYbVaWrQkAal8SbbPquN_LOFNO0MR5l2fISvJUS9pP1Yz/s1600/shelf+editor.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adding additional menu items to a shelf icon shortcut with the Shelf Editor</i></td></tr>
</tbody></table>
<br />
This is a a simple case of copy pasting the previous code into new menu items and replacing 'VrayMtl' or 'mia_material_x' with the relevant new material. Once you have your additional menu items, right clicking on the shelf icon will bring them up.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsdNnr3mcjqRrLRbG0wkxI841RZ7fn6PLO5rRM6up1XRUN1IZTtBXP4H5aX1liAvyBEkALDNNYCw3nFj-D_mYGWCVMANBwEumy-t1MLKhllu7HdszftCpo5VCSfwYOl8D8x7O_LlHOJSG/s1600/icon2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpsdNnr3mcjqRrLRbG0wkxI841RZ7fn6PLO5rRM6up1XRUN1IZTtBXP4H5aX1liAvyBEkALDNNYCw3nFj-D_mYGWCVMANBwEumy-t1MLKhllu7HdszftCpo5VCSfwYOl8D8x7O_LlHOJSG/s1600/icon2.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Quick access to frequently used materials</i></td></tr>
</tbody></table>
<br />
<br />
Of course, this shortcut is only one step reduced from using the actual right click menu, selecting 'Assign Favourite Material', and then selecting your material. But the point is it's still faster, and right clicking on a shelf icon brings up the menus instantly, whereas the right click menu takes a second to appear, which can be a little frustrating. Anyway, I like it. It makes me a happy Maya user.<br />
<br />
<br />
<br />
PS, for more material related shortcut goodyness, <a href="http://polygonspixelsandpaint.tumblr.com/post/43852335734">I also really like this one</a> from Dave Girard -author of '<a href="http://polygonspixelsandpaint.tumblr.com/post/18387995950">101 Autodesk Maya Tips</a>'...<br />
<br />
Basically it's just a fast way to get to an object's material attributes. This is like my favourite shortcut in Maya now. I have it mapped to 'Alt-A' (mapping it to CTRL-A apparently messed up a bunch of my other shortcuts or something).<br />
<br />
<br />
<br />
PSS, Apologies to anyone who has written to me asking a question and I've failed to reply. I'm not trying to ignore you, I'm just a new dad with a busy work schedule and there's just very little time between work and fatherhood for chasing things up. I'm just tired. Sorry about that. :(<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-22309256591713881252012-06-09T15:21:00.000-07:002013-02-02T14:37:38.292-08:00Radial Anisotropy w/ mia_material<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjekrpldfM-UyfYIgC1wxBHuqDkr8BlViTGdelqKhuAoS5m-m_vIh-T8QBqTk98xq3sNC2TU4ehEkyL3KhG1DhSqPis51iy2sn1j-UZ7TgmYnxAVnzuYN2T1HURktXZIftIRnpbPfZ0FKvX/s1600/titleimage3.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjekrpldfM-UyfYIgC1wxBHuqDkr8BlViTGdelqKhuAoS5m-m_vIh-T8QBqTk98xq3sNC2TU4ehEkyL3KhG1DhSqPis51iy2sn1j-UZ7TgmYnxAVnzuYN2T1HURktXZIftIRnpbPfZ0FKvX/s320/titleimage3.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Anisotropic Brushed Metal Material</i></td></tr>
</tbody></table>
<br />
<br />
Here's how to create a cool, radially anisotropic metal type shader with the mia_material in Mental Ray/Maya.<br />
<br />
<br />
<i><span style="font-size: x-small;">(PS, For a general introduction to anisotropic materials in CG, I recommend this <a href="http://www.neilblevins.com/cg_education/aniso_ref/aniso_ref.htm">great article</a> by Neil Blevins at his CG Education website).</span></i>
<br />
<i><br /></i>
<br />
Jumping straight in- first, let's create a simple object in which to apply our shader to. For convenience sake- let's just use a poly disk, which you can find (yes, Maya has a poly disk!) by holding shift and right clicking in the viewport, then selecting 'Poly Disk'. Then create a new mia_material (or mia_material x) in the hypershade and apply it to the new object.<br />
<br />
We're not going to worry about any of the other parameters apart from anisotropy for now; just scroll down through the mia_material until you reach the Anisotropy tab and click on it to extend it's parameters.<br />
<br />
In the Anisotropy section of the mia_material there are three main parameters to consider. An 'anisotropy' parameter set to the default of 1 actually produces no anisotropic specularity, instead we get a normal, run of the mill isotropic (same in all directions) or rounded highlight. By moving the slider past or below one, we are able to stretch the highlight out. I find that turning the slider all the way down to .1 works fine. You'll notice that as soon as you adjust the Anisotropy parameter, the other two parameters- Rotation and Channel, become unlocked.<br />
<br />
Next, we will need a texture in order to define the direction of our anisotropy. Click on the checker icon to the right of the Rotation parameter and select Ramp. In the ramp node, alter the Type to 'Radial Ramp', and make a two colour gradient that runs from black at the top to white on the bottom. Your sample swatch should look just like the one below. It's important to not get the colours reversed as that will not produce the desired result.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizbP2RqqbicRXF7Dv8QWfqA1WOfGFAD87tEUpaZTCNwwS8K_cFBy-bkiEHSezmU8PcW22d432Kw0wFB9-3mVPS_pklQwnRXNwybrAQJysS-O-82e24G9cpCIJaVmkF26NT3GODL7l4z1CX/s1600/ramp3.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizbP2RqqbicRXF7Dv8QWfqA1WOfGFAD87tEUpaZTCNwwS8K_cFBy-bkiEHSezmU8PcW22d432Kw0wFB9-3mVPS_pklQwnRXNwybrAQJysS-O-82e24G9cpCIJaVmkF26NT3GODL7l4z1CX/s1600/ramp3.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Make sure your ramp is set up correctly</i></td></tr>
</tbody></table>
<br />
<br />
At this stage you may want to do a quick test render. Turning on Mental Ray's IPR renderer can be useful when searching for a decent angle which will pick up the highlight. Rotate the camera around your object with IPR turned on and see how things are looking. Most probably you will observe a strange bending present in the highlight. This is where the 'Channel' parameter in the Anisotropy tab comes in. Default is -1. Set the channel to -2 and you should be now getting nice, straight, fanning anisotropic highlights (alternatively you can rotate the uv's of the disk 90 degrees).<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirnOmrfshz53-mNlblqp9d41xPJhgEKepApOEP-8nhwjrpSYD0zo5fT2cM-FsPw8RyVUEWXdK5CsIZdvQcfIbZI06O5P4cwwX8NiGNE44nduqd6QSL5pCVNCCtBW23wchdiAIru8ZeWXqY/s1600/ch1and2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirnOmrfshz53-mNlblqp9d41xPJhgEKepApOEP-8nhwjrpSYD0zo5fT2cM-FsPw8RyVUEWXdK5CsIZdvQcfIbZI06O5P4cwwX8NiGNE44nduqd6QSL5pCVNCCtBW23wchdiAIru8ZeWXqY/s320/ch1and2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Channel set to -1 on left, -2 on right</i></td></tr>
</tbody></table>
<br />
<br />
As far creating basic radial anisotropy with the mia_material, that's pretty much it.<br />
<br />
For a more metallic look, try dialing down the diffuse colour/weight in the shader and give your material something to reflect... ideally some nice image based lighting. It's also a good idea to break up the highlight a little by putting something like a constrasted circular brushed metal texture into the colour slot of the reflection tab. Play around with the glossiness and glossy samples also.<br />
<br />
You now have the unbridled power to create the bottoms of pots and pans and stereo knobs. :)<br />
<div style="text-align: center;">
<div style="text-align: left;">
<br /></div>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn8tCWqOtnIUxOqazFC8asS7PkCIjcVUVoU_HGlZ8krjAoa1-m2bClkwyiER3wVqO8xSSFAvu1Q9gO7Qw71_U_mszA2KBGlm8dHvpwENyoEJdGE-RME2s4-_0qiDEqpKkbPuS5WfKQp3tL/s1600/radialspec.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn8tCWqOtnIUxOqazFC8asS7PkCIjcVUVoU_HGlZ8krjAoa1-m2bClkwyiER3wVqO8xSSFAvu1Q9gO7Qw71_U_mszA2KBGlm8dHvpwENyoEJdGE-RME2s4-_0qiDEqpKkbPuS5WfKQp3tL/s320/radialspec.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Click to Enlarge</i></td></tr>
</tbody></table>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dwfEMpVJoJ_lZIjK5FHg_ZJaBc5FJpLPaZi_LydyoMDMynqAehvCzErXIaSKipkEGoTJWKxA13mluOQ_K5FNw' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<i><span style="font-size: x-small;">Final example shader (in motion)</span></i></div>
<br />
<br /></div>
Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com2tag:blogger.com,1999:blog-7811779271848849009.post-53967256301809336232012-05-31T12:33:00.001-07:002012-06-04T14:43:36.670-07:00Procedural Dents 'n' Dirt / Downward Drips (Part 3)<div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOZi5s-ByzlU1ayv24uh9p1RqWVtpFkRZfcdCH1r12NH4CPbLtl7tl5ODnXixCPz3hao0p0l0Il4jSYZbRBTvj_hbmujULQF6Q98D46Y5adXxco0PGmq2ZWYCudoUsmIi_u15TQyrgwP8Y/s1600/drips6.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOZi5s-ByzlU1ayv24uh9p1RqWVtpFkRZfcdCH1r12NH4CPbLtl7tl5ODnXixCPz3hao0p0l0Il4jSYZbRBTvj_hbmujULQF6Q98D46Y5adXxco0PGmq2ZWYCudoUsmIi_u15TQyrgwP8Y/s400/drips6.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>AO based weathering featuring DDD (Dents, Dirt, Drips)</i>
</td></tr>
</tbody></table>
<div style="text-align: center;">
<br /></div>
<br />
Lately I've been working on trying to get some directionality into an AO weathering type shader. A problem with my <a href="http://materialism-blog.blogspot.com/2011/08/procedural-dents-n-dirt-part-2.html">previous shader</a> was that the streaks weren't just dripping down from surfaces, but also dripping up. The current solution is to pipe the Out Colour of a Maya snow texture into both the bright and dark inputs of an AO node. Adjusting the 'depth decay' of the snow as well as the 'threshold' seem to be the main tweakable parameters here, along with AO spread.<br />
<br />
<br />
I'm attaching an .ma scene file + shader if anyone would like to experiment (12 mb)<br />
<a href="http://www.filedropper.com/ddddshader">http://www.filedropper.com/ddddshader</a><br />
<br />
<br />
Just the DDD shader<br />
<a href="http://www.creativecrash.com/maya/downloads/shaders/c/ddd-shader-dents-dirt-drips">http://www.creativecrash.com/maya/downloads/shaders/c/ddd-shader-dents-dirt-drips</a>
</div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com12tag:blogger.com,1999:blog-7811779271848849009.post-51587243480593486812012-04-02T05:10:00.006-07:002012-04-02T07:15:34.309-07:00Maya 2013 - New Node Editor<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: left;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiext8MYRWeuIxKFmg314dNxxxvO2uLvOIhgwbFkR90dM7A-UjVrw3sJVNrq1NWyIr7xokib03Am-WeyderdOfaFNEYfli9sHL704ImPEELZuV0tFpuB02cjXZS-Z33-GuimLCTz3DH0na2/s1600/node+ed.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiext8MYRWeuIxKFmg314dNxxxvO2uLvOIhgwbFkR90dM7A-UjVrw3sJVNrq1NWyIr7xokib03Am-WeyderdOfaFNEYfli9sHL704ImPEELZuV0tFpuB02cjXZS-Z33-GuimLCTz3DH0na2/s320/node+ed.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>A new look for Maya's next gen Node Editor</i></td></tr>
</tbody></table><i><br />
</i></div><div style="text-align: left;">Originally introduced as part of the Maya 2012 SAP (Subscription Advantage Pack), it appears that a new Softimage style node editor will be included with the upcoming release of Maya 2013, replacing the Hypershade/Hypergraph/Dependency Graph of previous versions. On first impression, I have to say I like the look of this new editor. Being able to quickly expand a node to get a better visual sense of input and output connections seems very useful. With this one new feature, the old secondary Connection Editor becomes redundant and everything is nicely unified within a single editor. Pretty nice.</div><div style="text-align: left;"><br />
</div><div style="text-align: left;">Another welcome addition which will save time is the new TAB field - allowing for a more convenient way to quickly search for and generate nodes, ala <i>Nuke</i>.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9q6I2mXWQIUotPFBydeSoop0eQs2H7HGdrEwaL9TAl9bo2nSQtHsUzQMlERraUfwMYoeOMfvQ_kMivuvaiaeesUqEpHh6ON_4QrWNH4czmOWN2mqw_KMZzM2PP_jhS7uUFJu6-Ck1suQ9/s1600/tab.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9q6I2mXWQIUotPFBydeSoop0eQs2H7HGdrEwaL9TAl9bo2nSQtHsUzQMlERraUfwMYoeOMfvQ_kMivuvaiaeesUqEpHh6ON_4QrWNH4czmOWN2mqw_KMZzM2PP_jhS7uUFJu6-Ck1suQ9/s1600/tab.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Press TAB to quickly search/create nodes</i></td></tr>
</tbody></table><br />
<br />
Check out the video below for a quick demo of the new Node Editor in action...</div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://0.gvt0.com/vi/_yi7J7cc00A/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/_yi7J7cc00A&fs=1&source=uds" /><param name="bgcolor" value="#FFFFFF" /><embed width="320" height="266" src="http://www.youtube.com/v/_yi7J7cc00A&fs=1&source=uds" type="application/x-shockwave-flash"></embed></object></div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><br />
</div></div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-35011034250547582362012-03-15T17:10:00.016-07:002012-03-16T02:31:00.903-07:00jjj_gammaTools 2.0.1<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDiN_qY7B08gUpndJnX_IyhcKfC0Ok8qG2YTG5szxuuvztYCJ2-3zNufbeNAP4xFDfHjc50PRk-EHec-ULa4KqVDCn5R_RI6pEdQtOMI94C6fk1O26y3wWA0vEobOC7zABZ3IjFcr5oK2w/s1600/gammacorrectbig.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDiN_qY7B08gUpndJnX_IyhcKfC0Ok8qG2YTG5szxuuvztYCJ2-3zNufbeNAP4xFDfHjc50PRk-EHec-ULa4KqVDCn5R_RI6pEdQtOMI94C6fk1O26y3wWA0vEobOC7zABZ3IjFcr5oK2w/s200/gammacorrectbig.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Gamma Correcting for every texture or colour swatch in a large shader network can be a chore</i></td></tr>
</tbody></table><br />
I've recently begun the search in earnest for useful maya scripts that can help cut down on repetitive tasks. One such gem I've stumbled across is a very helpful '<a href="http://download.autodesk.com/us/maya/2010help/Nodes/gammaCorrect.html">gammaCorrect</a>' node generating utility, which becomes extremely useful when working within a linear workflow in Maya. This tool automates the process of inserting gammaCorrect nodes wherever required in a shader network- specifically on colour swatches and 8 bit textures, in order to remove the encoded gamma of 2.2 and allowing them to render correctly in linear space.<br />
<br />
(If you're unfamiliar with linear workflow, I'd highly recommend <a href="http://vimeo.com/8119194">becoming aquainted with the subject</a>. It's super important...)*<br />
<br />
<br />
<a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/lighting/c/jjj_gammatools">Here is the MEL script...</a><br />
<br />
<i>(requires registration with the Creative Crash site)</i><br />
<br />
<br />
<a name='more'></a>Once downloaded, the script will need to be extracted into your local maya scripts directory. For most users, that will be located under Documents\Maya\(maya version)\scripts. With that done, you should be able to access the utility by typing 'jjj_gammaTools' into the MEL command line at the bottom of the Maya UI. Alternatively and perhaps preferably, you can <a href="http://www.youtube.com/watch?v=E44BwOY8b5Q">create a new custom shelf icon</a> via the Maya Shelf Editor that when clicked, runs the script automatically (make sure to add the line 'jjj_gammaTools' in the command tab of the Shelf Editor).<br />
<br />
The default maya gamma icon only comes in .svg format and is unsuitable as a shelf icon, so below I've provided a custom .png icon with transparency that you can use instead (right click: Save image as...). Icons generally go in the Documents\Maya\(Maya version)\prefs\icons folder.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC3rAe0c5JE49udROMgG-TUMp3KNAqo5XDMDQFb6_rj8HYuuUxljg2Mai70dbcs0rHqes1QvJLO5J3ByqsQzjZrQ2YpMR4BwpVj_euHaDs1x1_XeYLIrWqr5XC1YvXnvW8XRyJnD-HXcv5/s1600/gammacorrect.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC3rAe0c5JE49udROMgG-TUMp3KNAqo5XDMDQFb6_rj8HYuuUxljg2Mai70dbcs0rHqes1QvJLO5J3ByqsQzjZrQ2YpMR4BwpVj_euHaDs1x1_XeYLIrWqr5XC1YvXnvW8XRyJnD-HXcv5/s1600/gammacorrect.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Custom Icon</i></td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCtNd56AeA_DC21in5yfMxc3ZCPm-46CZGqFkK1LaORjG6PvOP6c4m4D5gF6nPzkVQ0O9VaEobO1bIjDWywEvtcTk-4DZJ0FLMKC-HO4KCDyejoocEeL-cxId6Keq5gczEytd_F330fJSj/s1600/shelfedit.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCtNd56AeA_DC21in5yfMxc3ZCPm-46CZGqFkK1LaORjG6PvOP6c4m4D5gF6nPzkVQ0O9VaEobO1bIjDWywEvtcTk-4DZJ0FLMKC-HO4KCDyejoocEeL-cxId6Keq5gczEytd_F330fJSj/s320/shelfedit.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Setting up a new custom shelf item in the Shelf Editor<br />
</i></td></tr>
</tbody></table><div><br />
</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzxMPOYFcA7wMPAxusPExXFpi5PDjit4EQPV5igEEJWktI8-5F0Pmz6FQMkqYfBnMiZajIMx4Qs9nuh6hDlwwgQFQX335bcgqSRRnUQ83a9wQo9_RjxaswdMGsM2Qq-7pv1sl59XPCLEbA/s1600/gammacorrect2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzxMPOYFcA7wMPAxusPExXFpi5PDjit4EQPV5igEEJWktI8-5F0Pmz6FQMkqYfBnMiZajIMx4Qs9nuh6hDlwwgQFQX335bcgqSRRnUQ83a9wQo9_RjxaswdMGsM2Qq-7pv1sl59XPCLEbA/s1600/gammacorrect2.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>My new best friend...</i></td></tr>
</tbody></table><div><br />
<br />
Once you've set up a new custom shelf item, you'll have a one button solution to managing your textures and colour swatches under a linear workflow. This is as simple as selecting a shader, running the jjj_gammaTools script (whether from the shelf or MEL command line) and clicking the 'update Selected' button in the popup UI. The script will work its magic and automatically insert gamma correct nodes (with a gamma of .454) wherever needed in your shader network. If you have tons of shaders you need to gamma correct for, then the 'Update All Shaders' button will do the job for you in no time at all. Essentially, extremely cool! </div><div><br />
</div><div><br />
</div><div>* Explanation of linear workflow is beyond the scope and purpose of this blog post. There are lots of great resources on the web which cover linear workflow and why it is important when working in 3d. Here's a partial list:</div><div><br />
</div><div><br />
</div><div><div style="text-align: center;"><a href="http://vimeo.com/8119194">Zeth Willie (4 part video on Vimeo)</a></div></div><div><div style="text-align: center;"><br />
</div></div><div><div style="text-align: center;"><a href="http://www.djx.com.au/blog/2010/03/07/maya-linear-workflow-in-two-steps/">DJX Blog (Maya Linear Workflow in Two Steps)</a> </div></div><div><div style="text-align: center;"><br />
</div></div><div><div style="text-align: center;"><a href="http://www.lysator.liu.se/~zap/lwf/main.html">Zap Andersson (Linear Workflow.com)</a></div></div><div><div style="text-align: center;"><br />
</div></div><div><div style="text-align: center;"><a href="http://www.seazo.no/linear-workflow">'Seazo' (Linear Workflow and Gamma explanation)</a></div></div><div><br />
</div><div><div><div><div><div><div class="separator" style="clear: both; text-align: center;"></div><br />
</div></div></div></div></div></div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0tag:blogger.com,1999:blog-7811779271848849009.post-11689668932320292562012-03-07T03:04:00.008-08:002012-03-16T07:46:09.948-07:00Light Based Ambient Occlusion<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4y7sUPHmUub25QvZMrsjRfckSysfUx-TnSKHjsbGgnIg0n_edoSNMPgJFgZiMZP6Rflnvm6HnLdOVOUsjoRrL2-__q85e5A-SKx4d7F7c424OxpNXLGA2g7Cxi5AWdUVqwusGuj-ABdme/s1600/right.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4y7sUPHmUub25QvZMrsjRfckSysfUx-TnSKHjsbGgnIg0n_edoSNMPgJFgZiMZP6Rflnvm6HnLdOVOUsjoRrL2-__q85e5A-SKx4d7F7c424OxpNXLGA2g7Cxi5AWdUVqwusGuj-ABdme/s320/right.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Ambient occlusion based on luminance </i></td></tr>
</tbody></table><br />
<br />
Here's a quick shader which will improve the look of your ambient occlusion pass by integrating it more closely with the directional lighting in your scene.<br />
<div><br />
</div><div><a name='more'></a><br />
Let's start by setting up a conventional ambient occlusion shader, by taking a 'mib_ambient_occlusion' node, and connecting it to the 'out_color' of a surface shader. </div><div><br />
</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwxKrTlllu6Zg8Fou2MCjlB_8jE_u6I0QBwGr0v2z-GM26t8MglZ_Xu9Us5XRjAG1M6DtlI25uEsalJA4sqg3u5c03bGgQ8whqKgO-yiCnPTZCF62CKbF-_o3xPC9J31qk_ZSfu8c6LF94/s1600/basic_ao.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwxKrTlllu6Zg8Fou2MCjlB_8jE_u6I0QBwGr0v2z-GM26t8MglZ_Xu9Us5XRjAG1M6DtlI25uEsalJA4sqg3u5c03bGgQ8whqKgO-yiCnPTZCF62CKbF-_o3xPC9J31qk_ZSfu8c6LF94/s1600/basic_ao.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Basic AO shader</i></td></tr>
</tbody></table><br />
The next step is to take a ramp node, and the magic ingredient... a <a href="http://download.autodesk.com/us/maya/2010help/Nodes/surfaceLuminance.html">'surfaceLuminance'</a> node, found under the Maya utilities section of the hypershade.<br />
<div><br />
</div><div>Set the ramp up to be a two colour V ramp, with white on top and black on the bottom. Then middle drag from the 'surfaceLuminance' node onto the ramp. There isn't a standard connection to make so you'll be taken into the Connection Editor to hook things up manually. </div><div><br />
</div><div>All that needs to be done is to connect the 'outValue' output of the surfaceLuminance to the 'uvCoord/vCoord' of the ramp. </div><div><br />
</div><div>Double click on the AO node, then middle drag your ramp into the AO's 'Dark' attribute. </div><div><br />
</div><div>Bingo. Now you have some nice natural AO that takes into account the luminance or light direction of your scene. No more dark occlusion in places where it obviously shouldn't be, for example hard edges which are being exposed to a lot of light. </div><div><br />
</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuxrpSdmC7qP46K29QjgcZEcnxRANl44voEMy_rs-xi-VzCMnYmAUQHxeRhY20jsPSMQ_Z2YBspIxUZQpCUFvNX1b4ENglTv2Upn-UFw4q9EelduHb7av7euvSDKI75ITAkw06VXpUnMqn/s1600/lightbased_ao.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="111" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuxrpSdmC7qP46K29QjgcZEcnxRANl44voEMy_rs-xi-VzCMnYmAUQHxeRhY20jsPSMQ_Z2YBspIxUZQpCUFvNX1b4ENglTv2Upn-UFw4q9EelduHb7av7euvSDKI75ITAkw06VXpUnMqn/s400/lightbased_ao.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>The finished light based AO shader</i></td></tr>
</tbody></table><div><br />
</div><div>Some examples...</div><div><br />
</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Emi3cZWjxHDAIB0nkJGZNaDP70EJLU-0tTjeFqgtY79WCvs1u6rSWE4Xfs815JXJLtWoBhtsRwxoQvfDFVbVG20CKgKckJtjQg8dCBCpKtOWG_U0Sk3s1T5NXcH70zyprLRcRIlG_DjE/s1600/standard.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Emi3cZWjxHDAIB0nkJGZNaDP70EJLU-0tTjeFqgtY79WCvs1u6rSWE4Xfs815JXJLtWoBhtsRwxoQvfDFVbVG20CKgKckJtjQg8dCBCpKtOWG_U0Sk3s1T5NXcH70zyprLRcRIlG_DjE/s320/standard.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Standard AO - shadowing is uniform in all directions</i></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdIQdAIM0-euBlobfnxHLa48JydjtuHNPB8VhSq9urRJ99auTeXIAaV9VCAS-4mJvW4D98WqHWo7NtC2AeozkMGapxH-t5D5GtXn1PGYR5g-pa6vnSjSL9kBQmSGShsZwwGsyLOpF115H/s1600/front.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRdIQdAIM0-euBlobfnxHLa48JydjtuHNPB8VhSq9urRJ99auTeXIAaV9VCAS-4mJvW4D98WqHWo7NtC2AeozkMGapxH-t5D5GtXn1PGYR5g-pa6vnSjSL9kBQmSGShsZwwGsyLOpF115H/s320/front.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Light Based AO - light is coming from the front direction<br />
</i></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOzsRwmBloM6euFyXy7wnF-BYRoDs4tRLreiVRsfjcJjmIYdILHONnrWv3Kda8J2kj3_oJGkjuAFGkvq6TZVA_7Sg67Q2693LEUeNzuCVVC9hvgIUI-Ymyfjg2xoZgc7dpYRe8wlWumb45/s1600/left.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOzsRwmBloM6euFyXy7wnF-BYRoDs4tRLreiVRsfjcJjmIYdILHONnrWv3Kda8J2kj3_oJGkjuAFGkvq6TZVA_7Sg67Q2693LEUeNzuCVVC9hvgIUI-Ymyfjg2xoZgc7dpYRe8wlWumb45/s320/left.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Light is coming from the left<br />
</i></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGVs995jMWnxMSSCigrrWHNL9WnRfrXp5sRkfRmNKUEQi1_qFnR7ZFJeDggdDhdOE8_1XPvgJsO_2bJuD8mhl41kTvVY0ZN6TSHY5rY3BKrmUjsYIlwAT0bXWcfIVPeC6Dw-n384ihobFJ/s1600/right2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGVs995jMWnxMSSCigrrWHNL9WnRfrXp5sRkfRmNKUEQi1_qFnR7ZFJeDggdDhdOE8_1XPvgJsO_2bJuD8mhl41kTvVY0ZN6TSHY5rY3BKrmUjsYIlwAT0bXWcfIVPeC6Dw-n384ihobFJ/s320/right2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Light is coming from the right</i></td></tr>
</tbody></table><div><div><br />
</div></div><div>Hope this is useful! :)<br />
<br />
</div><div><br />
<i>Thanks to Soner Unlu for passing on this handy technique.</i><br />
<br />
<br />
</div><div><br />
</div><div><br />
</div></div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com3tag:blogger.com,1999:blog-7811779271848849009.post-11410031928462975032012-02-26T10:42:00.105-08:002012-05-30T08:10:44.133-07:00Fake Parallax<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9eTpAowqp7WLF3GVUIOCy_dU2518hAIyj5p9qhBl3czOCUuMoMlFR5Mzp_j3u2FBI5AkZYjdC2B5gHjC8zs__b42prnE-KClws6m1GHSLVZm1ejHZtLRjo5L8s6aUpTzYAbJMbUn89MRD/s1600/basiceffect.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9eTpAowqp7WLF3GVUIOCy_dU2518hAIyj5p9qhBl3czOCUuMoMlFR5Mzp_j3u2FBI5AkZYjdC2B5gHjC8zs__b42prnE-KClws6m1GHSLVZm1ejHZtLRjo5L8s6aUpTzYAbJMbUn89MRD/s320/basiceffect.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Offsetting texture UVs via the camera normal</i></td></tr>
</tbody></table>
<br />
<br />
A good example of this shader is to imagine a building with a window cut into it, allowing the viewer to see through into the room beyond. Instead of modeling out the interior (which can be prohibitive in computer game environments where <a href="http://eat3d.com/materials">this trick is often applied</a>) we can use a texture of the room instead, aligned roughly to the outside wall, with an offset to give the viewer a parallax cue in order to make it appear as though the room has some sort of three dimensional depth.<br />
<br />
This is easier to understand when we can see things in motion - here's a quick setup scene to help illustrate.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe frameborder="0" height="400" src="http://player.vimeo.com/video/27395500?title=0&byline=0&portrait=0&autoplay=0" width="500"></iframe></div>
<br />
<br />
<br />
Obviously this technique has some limitations, but when used in mid to background elements in shots where the camera motion isn't too extreme, it may be just the thing needed to help add some quick depth to a 3D scene, cutting down on the time spent modeling, texturing and lighting an interior.<br />
<br />
So let's look at how we can go about setting up a shader which can recreate this parallax effect in Maya...<br />
<br />
<a name='more'></a><br />
<br />
<br />
First we will need a texture for the interior. Here's the one I used in the example scene-<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgag-CE9xbMbRj6NXwJ2PYrrQusNj1bT0djHpA2j8vSPpOxpGHfrJ96w_nWQKZXsJ_xVe7djfywelqfoE1ryIb9SBww82_htEtMxKMQo3RtuOMlh7_urzMa6E7cu3-cQ0jRHtl8geM6DPxI/s1600/interior.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgag-CE9xbMbRj6NXwJ2PYrrQusNj1bT0djHpA2j8vSPpOxpGHfrJ96w_nWQKZXsJ_xVe7djfywelqfoE1ryIb9SBww82_htEtMxKMQo3RtuOMlh7_urzMa6E7cu3-cQ0jRHtl8geM6DPxI/s320/interior.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Create a new cube in Maya with 1 face per side, select one of the faces and extrude it, scaling it inwards.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdVS541-dMNkM9Guq_oLw_ui-tGZtULgfNbIdubWyO5S2Us6vPo8FFPVJzhyGVtSXDZuonQouKX1ftYSVnmfIYCcm2moOOICk824X-RamumOKrZcmdU-TLUUzGA6p9Udt69CM4rrPuDTdO/s1600/box.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdVS541-dMNkM9Guq_oLw_ui-tGZtULgfNbIdubWyO5S2Us6vPo8FFPVJzhyGVtSXDZuonQouKX1ftYSVnmfIYCcm2moOOICk824X-RamumOKrZcmdU-TLUUzGA6p9Udt69CM4rrPuDTdO/s200/box.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Simple cube with extruded face</i></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The extruded face will serve as our window- select the face, right click and choose 'Assign New Material' from the context sensitive menu. Choose 'Surface Shader'. The rest of the box can retain the default lambert material for now.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the 'Out Color' of the surface shader, plug in your file texture.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDxZu2iUHofcypfVDWaLOz6LVoYiSGdqBD5v7TyUHkxZMyxuG0DnsZxlH8rfIr5MTt_TVGJoUiZleTiGthDsgUyJAtJB_MCfMfXqzkOR4vdhA3jB7WiO6yk24L_eqmLquFs-0SDAqGUaHL/s1600/intonbox.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDxZu2iUHofcypfVDWaLOz6LVoYiSGdqBD5v7TyUHkxZMyxuG0DnsZxlH8rfIr5MTt_TVGJoUiZleTiGthDsgUyJAtJB_MCfMfXqzkOR4vdhA3jB7WiO6yk24L_eqmLquFs-0SDAqGUaHL/s200/intonbox.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Face with Surface Shader applied</i></td></tr>
</tbody></table>
<br />
<br />
Note: You'll need to scale in your UVs a bit on the face with the surface shader applied. Doing so will give the texture some overhang or breathing room, otherwise you'll find the texture repeating as you change your angle of view.<br />
<br />
In the hypershade, select the surface shader and click the input connections icon. Then under the Maya utilities side panel, look for the <a href="http://download.autodesk.com/us/maya/2010help/Nodes/setRange.html">'Set Range'</a> and <a href="http://download.autodesk.com/us/maya/2010help/Nodes/samplerInfo.html">'Sampler Info'</a> nodes. Bring one of each into the work area and arrange the nodes roughly into the sequence shown below.<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk2HuiTdIS6UC5XIE2jopfrTaqyoqhr0Bw8Sa6s3SgZ6TWV-T65HrcDcNIfTZgR1uZBKMB0rzDoDlI7ade0fup6lPYdDkR8XL-x_8tkxmtx7LBYebzQeNH6z7goTP9wsgSlJaxBVi5U92H/s1600/sequence.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk2HuiTdIS6UC5XIE2jopfrTaqyoqhr0Bw8Sa6s3SgZ6TWV-T65HrcDcNIfTZgR1uZBKMB0rzDoDlI7ade0fup6lPYdDkR8XL-x_8tkxmtx7LBYebzQeNH6z7goTP9wsgSlJaxBVi5U92H/s400/sequence.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Setting out the nodes for the shader </i><br />
<i>(note: the samplerInfo node icon has changed in Maya 2012 compared to earlier versions)</i></td></tr>
</tbody></table>
<br />
<br />
<div>
Middle click from the 'Sampler Info' node onto the 'Set Range' node. Choose 'Other...' from the menu to enter the Connection Editor.<br />
<div>
<br />
Look for the 'Normal Camera' output in the left panel, choose 'Normal Camera X' and link it to the 'valueX' Input in the right panel. Repeat this step by linking the 'Normal Camera Y' with 'value Y'. Close the editor.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JdnZedNzxOGkci5jjiZq3MGyZMkM6idJIRgXFIqiYYOklg65_WeW8x-8GZb2PgfSA7nljwa6GI8-utwDCFavY47e70r8Uqgne-3RB5UkONo_SfVzKAllU6_e9XSmFgTbFau70sT2bm_4/s1600/normcam.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JdnZedNzxOGkci5jjiZq3MGyZMkM6idJIRgXFIqiYYOklg65_WeW8x-8GZb2PgfSA7nljwa6GI8-utwDCFavY47e70r8Uqgne-3RB5UkONo_SfVzKAllU6_e9XSmFgTbFau70sT2bm_4/s320/normcam.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Connecting samplerInfo to setRange</i></td></tr>
</tbody></table>
<br />
<br />
The next step is to connect the 'Set Range' to the offset U and V of the 'place2dTexture' node of the file texture. You'll need to use the Connection Editor again to make the required connection.<br />
<br />
In the outputs (left side) panel inside the Connection Editor, find 'outValue', and connect 'outValueX' to 'offsetU' in the right panel. Do the same for 'outValueY' and 'offsetV'.<br />
<br />
The setRange node works here as the control knob for the intensity (or perceived depth) of the texture offset. Bring up the attributes of the setRange node and firstly set the 'Old Min' values for both x and y to -1. Set the 'Old Max' values for x and y to 1.<br />
<br />
For the 'New Min' and 'New Max' values, you will need to play around a bit to find out what looks best for your shot. The general idea is the greater the range, the greater the offset will be. Smaller values (such as -.25 for the 'New Min' and .25 for the 'New Max'), will give a shallower parallax.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUSEHi1BRqh1CLHitktkQRAvFC-DAVno0BFraKpX5xIUz_jjuLDxkgqdzOh9RmPiUDLiTred72bzsAzN-uPO6swG30Y5PvvCQ17wpXd0rrFaxLvJE8rAYoZtGXSeDqWdOJExthXDQKMlMa/s1600/setrange.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUSEHi1BRqh1CLHitktkQRAvFC-DAVno0BFraKpX5xIUz_jjuLDxkgqdzOh9RmPiUDLiTred72bzsAzN-uPO6swG30Y5PvvCQ17wpXd0rrFaxLvJE8rAYoZtGXSeDqWdOJExthXDQKMlMa/s320/setrange.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adjust New Min/New Max values to control the parallax</i></td></tr>
</tbody></table>
<br />
<br />
That's it. :) Hope you can find some good uses for this interesting technique.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGMVzCaG0RoiDQ-qHMcw3_2OzTV9kQrSM6UpOePamjhhPUcYaiIZdmEUwAqxX8wz_2Yfn11lDokHDCGPNMV_LCuWmBIo1bezgLmocNYVu8t12sNurGH8zf9rbY9MgjkyPZ-McuK9LlW7P/s1600/finalshader.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="124" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGMVzCaG0RoiDQ-qHMcw3_2OzTV9kQrSM6UpOePamjhhPUcYaiIZdmEUwAqxX8wz_2Yfn11lDokHDCGPNMV_LCuWmBIo1bezgLmocNYVu8t12sNurGH8zf9rbY9MgjkyPZ-McuK9LlW7P/s640/finalshader.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Final Shader</i></td></tr>
</tbody></table>
<br />
<br /></div>
</div>
</div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com4tag:blogger.com,1999:blog-7811779271848849009.post-38979726917152932842011-08-08T06:53:00.007-07:002012-06-13T12:49:05.190-07:00Procedural Dents 'n' Dirt (Part 2)<div dir="ltr" style="text-align: left;" trbidi="on">
The terms 'Ambient Occlusion map' (or 'AO map') and 'Dirt map' are often used interchangeably. Vray has a node called 'Vray Dirt', which is actually just an ambient occlusion node. Recently I saw an advert for a<a href="http://www.enrichpro.com/en/richdirt/index.html"> 3ds Max plugin</a> that allows users to weather and dirty up their models with a fairly realistic looking procedural grime, complete with nice looking streaks. Ambient occlusion does a pretty good job of simulating the areas where dirt buildup is likely to occur on an object.<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitR52qYi6LztfDITnO5IByJ6kPVz2iQZf-YoCBkUt_QDXWs2EsWiyM-bPlqQL884AWweyuEuCzkpA7-_lYiHWluJRvc0M8rl8p5HxT9RD3ThKbCRQWSLviL9TwA6FxWY4ES6zbxti0_ki1/s1600/keyboard1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitR52qYi6LztfDITnO5IByJ6kPVz2iQZf-YoCBkUt_QDXWs2EsWiyM-bPlqQL884AWweyuEuCzkpA7-_lYiHWluJRvc0M8rl8p5HxT9RD3ThKbCRQWSLviL9TwA6FxWY4ES6zbxti0_ki1/s320/keyboard1.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>A very dirty keyboard</i></td></tr>
</tbody></table>
<br />
Today we'll go a little bit further in Maya than simply baking out an AO map; we'll use ambient occlusion as the beginnings of a mask for a procedural dirt texture. Then, as an enhancement we'll add some streaks in order to break things up a bit for a more natural look. Once finished, we will have created something that does a similar job to the commercial 3ds Max plugin described above, and we'll have saved $30! In <a href="http://materialism-blog.blogspot.com/2012/05/procedural-dirt-update-downward-drips.html">Part 3</a> we will conclude this tutorial by connecting the 'dirt' shader network to our 'dents' shader network (see <a href="http://materialism-blog.blogspot.com/2011/08/procedural-dents-n-dirt-part-1.html">Part 1</a>), for a very flexible overall shader that we can use in a variety of projects.<br />
<br />
<a name='more'></a>For this excercise, I'll be using a free architectural model of an office appartment I found online. More complex modeled architecture will provide better results than very simple models as the ambient occlusion will then have something to work with.<br />
<div>
<br />
Let's start by creating a new Maya Surface Shader- we'll also need a <a href="http://wiki.bk.tudelft.nl/toi-pedia/Mental_Ray_Ambient_Occlusion_tutorial">'mib_amb_occlusion'</a> node which can be found under the Mental Ray section of the <i>create bar</i> in the hypershade.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitmf18bYAoBiNAdnUZA8Bf3x70AeFL3BNZGKRPunP23EKhBjTyZfYxVH4iuY-AEWsEzvMs-9VjB8-krAXgYUH6PKKSw0M2_bIIo_VNeZLoIx_k3HIUjFrGo38DV_9oW5ZxpiDRhabz0MEu/s1600/tip1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitmf18bYAoBiNAdnUZA8Bf3x70AeFL3BNZGKRPunP23EKhBjTyZfYxVH4iuY-AEWsEzvMs-9VjB8-krAXgYUH6PKKSw0M2_bIIo_VNeZLoIx_k3HIUjFrGo38DV_9oW5ZxpiDRhabz0MEu/s200/tip1.jpg" width="183" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span class="Apple-style-span" style="font-size: small;"><i><span class="Apple-style-span" style="font-size: x-small;">Tip - you can quickly find which which node you're looking for by using the search feature located at the top of the create bar in the hypershade</span></i></span></td></tr>
</tbody></table>
<i><span class="Apple-style-span" style="font-size: x-small;"><br />
</span></i><br />
<i><span class="Apple-style-span" style="font-size: x-small;"><br /></span></i><br />
Connect the ambient occlusion node to the 'Out Color' of the Surface Shader (middle click and drag), then apply the Surface Shader to your object(s). Without changing any of the settings in the AO node apart from samples (I set to 64), I get a standard looking AO render back like this...<br />
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0AqHyMoJEU1WdJiQ_RtCewe3vtV02Ei8GauogzaUfzrRduThZ68iBBNPTmlMOmxCDU5bSC7EVikx0Lmib67IYdAHS1OJSMqeLkSrE2mzCtGOrxg3X1_c9UKgBgEqziipqwuWbnnTEcdx8/s1600/am1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0AqHyMoJEU1WdJiQ_RtCewe3vtV02Ei8GauogzaUfzrRduThZ68iBBNPTmlMOmxCDU5bSC7EVikx0Lmib67IYdAHS1OJSMqeLkSrE2mzCtGOrxg3X1_c9UKgBgEqziipqwuWbnnTEcdx8/s400/am1.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>A standard AO render</i></td></tr>
</tbody></table>
<div>
<br />
<div>
The next step is to create a new ramp. Click twice on the node to bring up its attributes, then click the 'x' icon for the middle colour in the ramp and delete that colour. We just need a simple two colour gradient, with white on top (important) and any colour for the bottom (it doesn't matter which colour as we'll be overriding it shortly). We now need to connect our AO node to the ramp- middle click on the AO node and drag onto the ramp, select 'other' and in we go to the Connection Editor...<br />
<br />
Inside the connection editor, we are looking for the 'outValue' output of the AO node- click the plus sign to the left of it and select 'outValueR' (or G, or B - it doesn't matter). On the right side window, look for 'UVcoord' and select the 'Vcoord' inside of that. Then close the editor. The AO node should now be connected to the ramp.<br />
<br />
Bring in a Maya 2d Fractal to the hypershade work area. Click on the ramp again to bring up its attributes, select the bottom colour swatch assigned to your ramp, and then middle drag the fractal to the 'selected color' in the ramp.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Z6dvVyJfvgOih6Qk9IUbXMjIPNBfJ5x6iuDQjCtqp5TZ_BAZJjDwNTZgt2Whe_APWPFJmQM1YP0LAd5gQIQlNYvRRD2mrwXV82b43mx9t5v1JHJ_2LuFzdKoY7ILAqg-aTFKdEtLbaMN/s1600/fractalramp.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2Z6dvVyJfvgOih6Qk9IUbXMjIPNBfJ5x6iuDQjCtqp5TZ_BAZJjDwNTZgt2Whe_APWPFJmQM1YP0LAd5gQIQlNYvRRD2mrwXV82b43mx9t5v1JHJ_2LuFzdKoY7ILAqg-aTFKdEtLbaMN/s320/fractalramp.jpg" width="303" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>The fractal is connected to the bottom colour in our 2 colour ramp</i></td></tr>
</tbody></table>
</div>
<div>
<br />
<br />
By using only the default settings in the fractal, but changing the number of uv repeats in it's 2D placement node to 15 for U and 15 for V, I now get a render back which looks like this...<br />
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHEyUlKSMckIuVSWqb6F_Nje57FP9supD2pEZJRj_RdXmQf3bLTNrImx3b29xlkkHA9L-GKQc6sIA084auPtoSuVBz2eG-xW6_ve5fqy1Ws4uDhUB4_Dl7_jgQDEjoTF-Y5hAmAfbzZoK2/s1600/frac2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="329" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHEyUlKSMckIuVSWqb6F_Nje57FP9supD2pEZJRj_RdXmQf3bLTNrImx3b29xlkkHA9L-GKQc6sIA084auPtoSuVBz2eG-xW6_ve5fqy1Ws4uDhUB4_Dl7_jgQDEjoTF-Y5hAmAfbzZoK2/s400/frac2.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adding a procedural texture to break up the AO</i></td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
Notice how the ambient occlusion is being broken up by the fractal texture. Its a good start for some architectural grime, but we can go further. How about some streaks? For a streaking effect, a better idea is to use a 3D fractal rather than a 2D one, as a 2D fractal is UV dependent, but with a 3D fractal however, we can make the streaks always run vertically, even if some of our model UVs are rotated.<br />
<br />
Break the connection between the ramp and the original 2D Fractal (but don't delete the node). Bring in a new 3D (or Solid) Fractal and play around with the settings until you arrive at something you think may work for streaks.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH3PbbUe9SrJNXRY3U57ceo7E-BllxNmOfOhhVHkdcvkAgqr_RGQRL3n_zim-10xc_vy10iMVVrmRZJcXBvitoLhVYuIdp7iV4EIcFlGelu70I8KLroSnlCf-cxeDmoRCLlalk2xf04Fpu/s1600/solidfrac1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH3PbbUe9SrJNXRY3U57ceo7E-BllxNmOfOhhVHkdcvkAgqr_RGQRL3n_zim-10xc_vy10iMVVrmRZJcXBvitoLhVYuIdp7iV4EIcFlGelu70I8KLroSnlCf-cxeDmoRCLlalk2xf04Fpu/s400/solidfrac1.jpg" width="272" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adjust the new Solid Fractal settings</i></td></tr>
</tbody></table>
</div>
<div>
<br />
<br /></div>
<div>
In order to get the streaking effect to work properly we need to adjust the scale in the 3D placement node of the new Solid Fractal...</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJgI5nicenSAg6Q7Md3ISR-VGTrHyoGXzavSk2HDjtJi_dVuzGsO-YeBpjF_jchjuWSu7EE_l3OwDVRYXDkESCkP4YmgCl-MJ5gedIrMtjg3W4JVposPpFNpCa1FFmy2lj64lEpc65U5RQ/s1600/solidplace.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJgI5nicenSAg6Q7Md3ISR-VGTrHyoGXzavSk2HDjtJi_dVuzGsO-YeBpjF_jchjuWSu7EE_l3OwDVRYXDkESCkP4YmgCl-MJ5gedIrMtjg3W4JVposPpFNpCa1FFmy2lj64lEpc65U5RQ/s320/solidplace.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Stretching the scale in Y in for a streaking effect</i></td></tr>
</tbody></table>
<div>
<br />
<br /></div>
<div>
With the bottom colour of the ramp selected, middle drag the Solid Fractal to the 'selected color' of the ramp, the same way as with the previous 2d Fractal.<br />
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmY4F_lUDMIxz5I-bIkS1m8-h1dnTQjAvA0PlawgiLo7M_hdhp7UEtH4qyojsT4M4OOb6xnuucJWxszo1-NXDp1CJrutZIxqgB3v4l1I9zyBW8stDrQhsvyd4pbQXlTBxhrSTamGPAL2db/s1600/streaks_1b.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="381" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmY4F_lUDMIxz5I-bIkS1m8-h1dnTQjAvA0PlawgiLo7M_hdhp7UEtH4qyojsT4M4OOb6xnuucJWxszo1-NXDp1CJrutZIxqgB3v4l1I9zyBW8stDrQhsvyd4pbQXlTBxhrSTamGPAL2db/s400/streaks_1b.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Result</i></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
So so. For a softer effect, you can try plugging your original 2d fractal into the colour gain (to be found under 'color balance' in your texture settings) of the 3D fractal.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaknoBvyGWoiZ8KyKYFPCbeJbuTlgawCP33s0KkMySNh5UNIZqZ1HzOq8-IoxBvFWyqf2RnPCcF0_gvkEwq0-sftL3yUycnprdIh6DDBLXm38GSIfW9mn_0YNlmp94gP37kWa92G0ZsbAL/s1600/streak2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="611" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaknoBvyGWoiZ8KyKYFPCbeJbuTlgawCP33s0KkMySNh5UNIZqZ1HzOq8-IoxBvFWyqf2RnPCcF0_gvkEwq0-sftL3yUycnprdIh6DDBLXm38GSIfW9mn_0YNlmp94gP37kWa92G0ZsbAL/s640/streak2.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Final Result</i><br />
<i><br />
</i><br />
<i><br />
</i></td></tr>
</tbody></table>
</div>
<div>
Ok great! That's the basic idea then...procedurally generated dirt and streaks, based on ambient occlusion. Keep adjusting and experimenting to preference, trying different kinds of textures, altering your AO settings, etc... </div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVmIcIghwREpgM9AtQf58Ha8TKGSD0rFwsmMa_ByncSugfx3HbBz-GSOJXO68v-rsryQw4XVNvsemsCAIkIFYzTT7kBCnVYMM7FonDC5M9pcliq7DTJBe9M40qyaEz0ohRkJO291-ZkoC/s1600/final+shader.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZVmIcIghwREpgM9AtQf58Ha8TKGSD0rFwsmMa_ByncSugfx3HbBz-GSOJXO68v-rsryQw4XVNvsemsCAIkIFYzTT7kBCnVYMM7FonDC5M9pcliq7DTJBe9M40qyaEz0ohRkJO291-ZkoC/s1600/final+shader.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Final shader (with the 2d fractal connected to 'color gain' in the 3d fractal)</i></td></tr>
</tbody></table>
<br />
Hope this was useful. See you in <a href="http://materialism-blog.blogspot.com/2012/05/procedural-dirt-update-downward-drips.html">Part 3</a>! :)<br />
<br />
<br />
<br /></div>
</div>
</div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com3tag:blogger.com,1999:blog-7811779271848849009.post-69095475726211346812011-08-05T06:50:00.007-07:002012-06-13T12:51:16.521-07:00Procedural Dents 'n' Dirt (Part 1)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: cyan;"><i>edit: This post has been updated as of 6/13/2012, to account for a previous missed step in the shading network (insert clamp node). </i> </span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje4YenhC_MUi_Di_VETTelIvPhgTHrQTN3q7TpIjvstozax6EY0na87X_fkkNwSqG6OuplPIZFgN6XAByhtNBRM1SHQETQ4z6YchowyM03fZmip6gWZ-AaCmRmowqZ0t5FDda2g_ZFOCqY/s1600/example.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje4YenhC_MUi_Di_VETTelIvPhgTHrQTN3q7TpIjvstozax6EY0na87X_fkkNwSqG6OuplPIZFgN6XAByhtNBRM1SHQETQ4z6YchowyM03fZmip6gWZ-AaCmRmowqZ0t5FDda2g_ZFOCqY/s1600/example.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Example shader </i></td></tr>
</tbody></table>
<br />
This is a really great technique for quickly generating some chips and dents along the outside edges of your model, as well as adding a layer of dirt (in <a href="http://materialism-blog.blogspot.com/2011/08/procedural-dents-n-dirt-part-2.html">part 2</a>) to the more recessed areas. Once you have a handle on this technique you can then customise and apply it to all manner of materials. For this shader we will be utilising two of the Mental Ray nodes- a <span class="Apple-style-span" style="color: #6aa84f;">'<a href="http://www.artbycrunk.com/tutorial/maya/ambient-occlusion-using-mib_amb_occlusion_node/">mib_amb_occlusion</a>'</span> node as well as a <span class="Apple-style-span" style="color: #6aa84f;">'<a href="http://www.geonak.com/mytuts/tuts/mia_roundcorners_Maya.pdf">mia_roundcorners</a>'</span> node.<br />
<br />
Firstly, let's work on generating some chips and dents for our model...<br />
<br />
<br />
To get a better sense of what we're aiming for, here are some images which show the effect of edge chipping...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe_k3F4LyDxUGgL4j9BN2h3BTi3X7LtfDL0zSLy3Dvnu9tmN-lg4ZnBlsWSncgVw4eLuxkqOicS_BUpCenJ4UGExqh4lgfk_n0euW5kipX8ROc5or__NmomlxrZ_Q6B0sH6aouMrjiTnSW/s1600/examples.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe_k3F4LyDxUGgL4j9BN2h3BTi3X7LtfDL0zSLy3Dvnu9tmN-lg4ZnBlsWSncgVw4eLuxkqOicS_BUpCenJ4UGExqh4lgfk_n0euW5kipX8ROc5or__NmomlxrZ_Q6B0sH6aouMrjiTnSW/s640/examples.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Examples of images of edge chipping on a variety of materials</i></td></tr>
</tbody></table>
<br />
<br />
Alright. Some nice subtle and not so subtle edge chipping. By looking at these shots we can appreciate that many objects in the real world show signs of this kind of wear and tear. What this means when it comes to our models and textures is that often times it is not enough to just simply apply a bevel to our object- but we should also think about introducing some variation into the bevel itself for added realism. We want to break up the bevel. How much will depend on our object, it's age and the material we are trying to represent.<br />
<br />
<br />
So let's start... In the hypershade, bring two new 'mia_roundcorners' nodes into the work area. We also need to bring in an additional node- one of the Maya utility nodes- called 'Vector Product'.<br />
<br />
Double click on the Vector Product node to bring up it's attributes window. Then, with mouse pointer over one of the roundcorners nodes in the hypershade, middle click and drag over to the 'input 1' slot in the Vector Product attributes. Release the middle button and the two nodes should now be connected. Do the same for the other roundcorners node but this time connect it to the 'input 2' of the vector product.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSsl2Y0tUel2cFeuTkdcsexKzEkgb6SHzeAsz4WyUtmkbYRl2TKeyaoJwuehBXBrIqV7iWEK9ZlY4IqQXO4Yl7j_TKJ3uWXwp1lk7L6OVw9AkPT2-XpR3tlxbSNM_P_rDMwe1o8t7xhfPP/s1600/2bumps1vector.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSsl2Y0tUel2cFeuTkdcsexKzEkgb6SHzeAsz4WyUtmkbYRl2TKeyaoJwuehBXBrIqV7iWEK9ZlY4IqQXO4Yl7j_TKJ3uWXwp1lk7L6OVw9AkPT2-XpR3tlxbSNM_P_rDMwe1o8t7xhfPP/s1600/2bumps1vector.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Two roundcorners_bump nodes connected to input 1 and input 2 of a Vector Product node</i></td></tr>
</tbody></table>
<br />
<div>
So far, so good.<br />
<br />
<br />
<a name='more'></a><br />
<br />
The next step is to change the radius value in <i>one</i> of the roundcorners nodes. Before doing that though, for testing purposes let's also bring in a Maya surface shader to the work area in the hypershade. This will act as our 'dummy' shader. Double click on the surface shader to bring up its attributes, then middle mouse drag from the Vector Product node into the 'color' slot of the surface shader. Now we have the output from the Vector Product node running into the colour slot of the surface shader. Create a standard poly cube and apply the surface shader to the cube. A render (we will need to be rendering in Mental Ray) will show that our cube is black.<br />
<br />
Go into each of the roundcorners nodes and change the 'bump mode' parameter there from 0 to 5. Make another render. Our cube should now be white.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAbu0wtTt7pK6VTx9CqKhfdrcWdAeUbnNF75U3V98vhAba3PaX3JNfQV9yJU77RJTGD33R6Z8_wT7VzdX7hv-NYPbsgvYRGCWQt2mGjVZLO90-FvNGtRqwFtKXG5PF9fjXB5Qbdt8q87FA/s1600/cube.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAbu0wtTt7pK6VTx9CqKhfdrcWdAeUbnNF75U3V98vhAba3PaX3JNfQV9yJU77RJTGD33R6Z8_wT7VzdX7hv-NYPbsgvYRGCWQt2mGjVZLO90-FvNGtRqwFtKXG5PF9fjXB5Qbdt8q87FA/s320/cube.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>A surface shader is applied to our test object (bump mode set to 5 in our roundcorners nodes)</i><br />
<i><br />
</i><br />
<i><br />
</i></td></tr>
</tbody></table>
Now, in the attribute settings of <i>one</i> of our nodes, increase the radius to .1. Hit render. You should get back a result that now looks something like this...<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaGYlj9prUEIzhKSA0bT_cbhikvWAV1httWHIgibL7tDoOgQo0OV5y6ToJN-eKe3Lp8W6juQWLXifRVAhHZ65iDFrAqxTywcyXesauaGiOg2fBY3Zcb1sF97DA-OT8GVm1SOnmlQiVHhRF/s1600/cube_2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaGYlj9prUEIzhKSA0bT_cbhikvWAV1httWHIgibL7tDoOgQo0OV5y6ToJN-eKe3Lp8W6juQWLXifRVAhHZ65iDFrAqxTywcyXesauaGiOg2fBY3Zcb1sF97DA-OT8GVm1SOnmlQiVHhRF/s400/cube_2.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adjusting the radius in one of the roundcorners nodes</i></td></tr>
</tbody></table>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
<div>
Your result may differ depending on how big your cube is, so you may want to adjust the radius up or down. This is why it's a good idea to use a dummy shader as it helps you to see exactly what you're doing. For even faster feedback, you can use Mental Ray's IPR rendering while you make your adjustments. </div>
<div>
<br /></div>
<div>
Now we have a great starting point for our chips and dents. This will act as our basic mask and tell our shader where and where not to apply wear and tear. </div>
<div>
<br /></div>
<div>
Create a new ramp and then alter the gradient colours to match the below image, with black (or any colour) on bottom and white on top.</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCgeHFiEtpiLddHVzs1-H4Vx715Xf9nU3kZJRNy8egRLzcW6sVmvfjAZtQX6AY5PTlr9sgtyoqR459gAmPt98TkMbaSRz8T5ybA879olV_6QUR26ozeS5iCi_rFKk3hcHgt_WWfzsfWxp_/s1600/ramp.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCgeHFiEtpiLddHVzs1-H4Vx715Xf9nU3kZJRNy8egRLzcW6sVmvfjAZtQX6AY5PTlr9sgtyoqR459gAmPt98TkMbaSRz8T5ybA879olV_6QUR26ozeS5iCi_rFKk3hcHgt_WWfzsfWxp_/s320/ramp.jpg" width="299" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adjusting the ramp</i></td></tr>
</tbody></table>
<div>
<br />
<br />
The next step requires us to insert a Clamp node between the Vector Product Node and the Ramp. If we don't clamp the output of the vector product then we'll end up with some funky results. Create a Clamp node and middle click drag the Vector Product onto the Clamp and choose 'input'. We'll need to clamp the new minimum values to 0 and new maximum values to 1. The attributes in the Clamp node should look like this...<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyTlG0cjPuyeM_NS9Np0EUYIr5kK6uT-F82oNWqAxMy1Um4ajWV-K3S2PEyJKEYUwhoKtWjSFGOi-gq1sFnoq09C9gg68eDe0RXzvTrRfyKsfILIWua4FKI5qsPPyjlMg5c1xZFkRcnEFU/s1600/clamp.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyTlG0cjPuyeM_NS9Np0EUYIr5kK6uT-F82oNWqAxMy1Um4ajWV-K3S2PEyJKEYUwhoKtWjSFGOi-gq1sFnoq09C9gg68eDe0RXzvTrRfyKsfILIWua4FKI5qsPPyjlMg5c1xZFkRcnEFU/s400/clamp.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>You will need to clamp the output from the Vector Product</i></td></tr>
</tbody></table>
<br />
<br />
The next step requires using the connection editor. Middle click and drag from the Clamp node onto the ramp, then select 'Other...' from the pop up menu. Once inside the Connection Editor, look for the parameter 'output' on the left hand side window (the vector product node). Click the + sign to the left of 'output' and then click on either outputX,Y, or Z. On the right hand side panel (the ramp) look for 'uvCoord', it should be greyed out. Click the + sign next to it and then select 'vCoord'.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_gb5NcGDoIP_5Uy0XtTDHTrnG42P34eQWNHa18eehs92TTmb4KuFm7oMhTh1Xk2prqdgFKTM-6n8grhhQi-W6Z2bzFrZGugMK-ea0LM5jYCBWrBSjuDwwQEaJVqMFr4VLTtvjUGWUkuDw/s1600/connect.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_gb5NcGDoIP_5Uy0XtTDHTrnG42P34eQWNHa18eehs92TTmb4KuFm7oMhTh1Xk2prqdgFKTM-6n8grhhQi-W6Z2bzFrZGugMK-ea0LM5jYCBWrBSjuDwwQEaJVqMFr4VLTtvjUGWUkuDw/s400/connect.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Parameters in italics are connected </i></td></tr>
</tbody></table>
<br />
<br />
Now that that's taken care of, we'll create a procedural texture in order to break up the edges. Here I am using a 2D mountain node but you can use whatever you like. For a more chipped effect it makes sense to use a texture with a hard falloff. Here are the settings I've used in my mountain texture.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3lYRU58e_MMIjZw_4r8XGpvqPcHZKBWLC3cIiwRvNOCvYt8AxpYdnP3Iv3xXeJYfri2uIVZ396Uo1UHMs7FNQDqssmReMEQvhlbiLIviCoYdso02q_5b6odnBhzxBsyt_0TTRuTkgcf86/s1600/mountain.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3lYRU58e_MMIjZw_4r8XGpvqPcHZKBWLC3cIiwRvNOCvYt8AxpYdnP3Iv3xXeJYfri2uIVZ396Uo1UHMs7FNQDqssmReMEQvhlbiLIviCoYdso02q_5b6odnBhzxBsyt_0TTRuTkgcf86/s1600/mountain.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Mountain settings</i></td></tr>
</tbody></table>
<br />
<br />
Click on the ramp again, make sure the black colour in your gradient is selected, then middle click and drag your new texture to the 'selected color' slot of your ramp. Your network should now look something like this...<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCCZHNPMSb2OqIAkFjdEM2V5XZl0-GLQ0M19hlTp7ZUajY0qVfDHsgnhuKrJjkrkHpBXSSqFkFG0hRzarsf8xdxEOt__V6D-SpqeXP1s9o0TUtPOwZq9wchl7p2vRb4wdRAeuirHlSfze4/s1600/clamptoramp.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCCZHNPMSb2OqIAkFjdEM2V5XZl0-GLQ0M19hlTp7ZUajY0qVfDHsgnhuKrJjkrkHpBXSSqFkFG0hRzarsf8xdxEOt__V6D-SpqeXP1s9o0TUtPOwZq9wchl7p2vRb4wdRAeuirHlSfze4/s320/clamptoramp.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>The shading network so far, dummy shader removed</i></td></tr>
</tbody></table>
<br />
<br />
Bring in a new <span class="Apple-style-span" style="color: #6aa84f;">'<a href="http://www.kxcad.net/autodesk/maya/Maya_Documentation/ArchGuide/arch_mtl.html">mia_material x</a>'</span> node as well a <span class="Apple-style-span" style="color: #6aa84f;">'bump 2D'</span> or <span class="Apple-style-span" style="color: #6aa84f;">'bump 3D'</span> node (depending on whether your texture is a 2D or 3D texture). Middle drag the ramp to the 'Bump Value' slot of your bump node. Then connect the bump to the 'Overall Bump' slot of your mia_material. Assign the mia_material to your test object and do a quick render.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTVd8mtAAUIG1OTgyJBYGnbqpRI2ghfuvZr2LxuemXnu70muSG2gu41Qv7y1HQ8Lnn6XIm1vqC7BCI8NRj1xFnp_o4SL1BI5zgNW7bp3HnuTQLX950ZuSktuSXVo8eG6DrvJcqdGYPmOM-/s1600/chips1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTVd8mtAAUIG1OTgyJBYGnbqpRI2ghfuvZr2LxuemXnu70muSG2gu41Qv7y1HQ8Lnn6XIm1vqC7BCI8NRj1xFnp_o4SL1BI5zgNW7bp3HnuTQLX950ZuSktuSXVo8eG6DrvJcqdGYPmOM-/s1600/chips1.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>The basic chipping effect</i></td></tr>
</tbody></table>
<br />
<br />
Alright. We now have some basic chips on the edges of the object. The effect looks a little extreme but we can tone down the intensity of the bump in a few ways- by adjusting the 'bump depth' in the bump node, by adjusting the texture (in my case I might alter the 'rock color' in my mountain texture from black to a light grey), and/or by changing the radius in our roundcorners node.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW9pqg-3W-zooXCcZ4Osj-5tYH0QVXO56Y3JEiVfYTN7VR5b1G_qSJQx8pwEzsdbW2s-oLhmDRT_d265AFAdYvhWwXuMDQVeF_P_bR9iDybzBmLxLKQGkSGre-jQDY_YRt6zOyPaN7Wp7l/s1600/chipadjust.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW9pqg-3W-zooXCcZ4Osj-5tYH0QVXO56Y3JEiVfYTN7VR5b1G_qSJQx8pwEzsdbW2s-oLhmDRT_d265AFAdYvhWwXuMDQVeF_P_bR9iDybzBmLxLKQGkSGre-jQDY_YRt6zOyPaN7Wp7l/s1600/chipadjust.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Adjusted for subtlety</i></td></tr>
</tbody></table>
<br />
<br />
A couple of things before wrapping up. The first is to mention that this technique works very well on hard edged objects, but fails on pre-bevelled or smooth objects. Basically, it will work where roundcorners works on your object (great for mid-distance objects with simple geometry). The second thing is that you can enhance the look of your shader by putting <i>another</i> roundcorners node into the 'Standard Bump' slot of your mia_material_x (you need to use mia_material_x as the standard mia_material (the non x variety) does not have two slots for bump). Just adjust the radius on your new roundcorners to get an all round bevelling effect on your object. The chips and dents will interact well with the new bevel as the standard bump gets applied on top of the overall bump. If your bumps are reversed then you will not get that nice broken line in the lighting of your bevel, which is really the whole point of this technique.<br />
<br />
That's it for part 1. Stay tuned for <a href="http://materialism-blog.blogspot.com/2011/08/procedural-dents-n-dirt-part-2.html">Part 2</a>!<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit7AwVVp__m6twYUc3pyQMfIjvlEsjG7ZXm453nxpI_2XZ8eMbnDFaHxfcy3PN1foNBI6NaWWQ8O0wItzQ9BS-Z-x5c-x3RkFjpbXIOdG_vBVFU18E2kuM0SJ1iz3UU7W3o6Zav6Zbx6lN/s1600/finalshader2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit7AwVVp__m6twYUc3pyQMfIjvlEsjG7ZXm453nxpI_2XZ8eMbnDFaHxfcy3PN1foNBI6NaWWQ8O0wItzQ9BS-Z-x5c-x3RkFjpbXIOdG_vBVFU18E2kuM0SJ1iz3UU7W3o6Zav6Zbx6lN/s320/finalshader2.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>Final shader</i></td></tr>
</tbody></table>
<div style="text-align: center;">
<br /></div>
</div>
<div>
PS - Many thanks go to J M Bihorel who originally showed me the basis for this very handy technique. You can find J M at his blog, <i><a href="http://jmbihorel.wordpress.com/">here...</a></i><br />
<br />
<i><span style="color: red;">edit: This post has been updated as of 6/13/2012 to account for a previous missed step in the shading network (insert clamp node). </span></i><br />
<br />
<br /></div>
</div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com1tag:blogger.com,1999:blog-7811779271848849009.post-11872009550338704482011-08-04T03:21:00.004-07:002012-03-06T12:00:50.008-08:00Welcome :)<div dir="ltr" style="text-align: left;" trbidi="on">Welcome to Materialism, a blog primarily about shading networks and materials. Hopefully over time this site will start to serve as a repository of neat shader tricks and information that people may be able to find useful in their own projects. The focus will be on Mental Ray for Maya in the beginning, with a possible expansion into other rendering engines and 3d packages as time goes on. Whenever I can personally learn something new and interesting which I feel has not been posted ad infinitum elsewhere on the web- I'll aim to make a post on it.<br />
<br />
I'll likely be experimenting with basic design and functionality of the site over the next few weeks.<br />
<br />
Hope you enjoy :)</div>Stuart Tozerhttp://www.blogger.com/profile/02169232290366220959noreply@blogger.com0