<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Softimage Blog &#187; Texturing</title>
	<atom:link href="http://www.softimageblog.com/archives/category/texturing/feed" rel="self" type="application/rss+xml" />
	<link>http://www.softimageblog.com</link>
	<description>People and thoughts behind Softimage in production...</description>
	<lastBuildDate>Mon, 21 Jun 2010 20:40:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vintage Softimage &#8211; A tribute to Phoenix Tools and Arete</title>
		<link>http://www.softimageblog.com/archives/504#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=vintage-softimage-a-tribute-to-phoenix-tools-and-arete</link>
		<comments>http://www.softimageblog.com/archives/504#comments</comments>
		<pubDate>Fri, 04 Jun 2010 16:55:40 +0000</pubDate>
		<dc:creator>Stefano Jannuzzo</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Texturing]]></category>
		<category><![CDATA[World of VFX]]></category>

		<guid isPermaLink="false">http://www.softimageblog.com/?p=504</guid>
		<description><![CDATA[The middle-aged of you will probably remember those names from the 90s.
Phoenix Tools was a plugin company for Softimage 3D, and I was one of the founders. We did good and bad, and we eventually closed down in 2002.
Arete had an excellent reputation for their ocean and atmospheric library, called Digital Nature Tools. I think [...]]]></description>
			<content:encoded><![CDATA[<p>The middle-aged of you will probably remember those names from the 90s.</p>
<p>Phoenix Tools was a plugin company for Softimage 3D, and I was one of the founders. We did good and bad, and we eventually closed down in 2002.</p>
<p>Arete had an excellent reputation for their ocean and atmospheric library, called Digital Nature Tools. I think their main business was in military simulation, however they had a part in every cg-generated ocean in the movies of the 90s.</p>
<p>In 2001 we joined forces to port their software under XSI (I think it was 2.0). Unfortunately, after the first version came out, both companies shut down.</p>
<p>8 years later, I am working on a feature animation with a few shots in water, and I realized I still had on some cd the arete psunami libraries. So, I decided to give it a try. I removed the license check from the shaders and I compiled them with good old Visual Studio 6, linking against the oldest mental ray library I could find (3.3), and in the end it worked. I was kind of touched when I finally saw the displaced grid rendering in Softimage 2010.</p>
<p>I think I will do no harm to anybody releasing these shaders. Both companies are dead since long, and this is my little tribute to them and the talented people who worked there.</p>
<p>The <a href='http://www.softimageblog.com/userContent/upload/2010/06/PT_Arete_Dnt.xsiaddon.zip'>addon is only available for win32</a>, and no, no chances for other platforms. That Arete library is the only one I have. If you do, use it at your own risk (and fun, i would say. There are probably better ways to do oceans nowadays).</p>
<p>And, you know what, I don&#8217;t even know how the full package works. I don&#8217;t have anymore the documentation, nor the scripts we provided. If my old companions will find them, I will post them later.</p>
<p>The basic usage however is easy. You have to connect a DNT_Ocean_Sh and DNT_Time to a DNT_Ocean_Evolver. What come out is the ocean instance, that can then go into the other nodes. Also, you want to apply DNT_Air as environment to have nice reflection and the atmosphere.</p>

<a href='http://www.softimageblog.com/archives/504/arete-1' title='Arete #1'><img width="150" height="103" src="http://www.softimageblog.com/userContent/upload/2010/06/arete.1.jpg" class="attachment-thumbnail" alt="Arete - displacement and optics" title="Arete #1" /></a>
<a href='http://www.softimageblog.com/archives/504/arete-2' title='Arete #2'><img width="150" height="100" src="http://www.softimageblog.com/userContent/upload/2010/06/arete.2.jpg" class="attachment-thumbnail" alt="Arete - Optics only" title="Arete #2" /></a>
<a href='http://www.softimageblog.com/archives/504/arete-3' title='Arete #3'><img width="150" height="99" src="http://www.softimageblog.com/userContent/upload/2010/06/arete.3.jpg" class="attachment-thumbnail" alt="Arete - Bump only rendered with a phong material" title="Arete #3" /></a>

<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=504&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/504/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Bump Filtering in the Rendertree</title>
		<link>http://www.softimageblog.com/archives/262#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=bump-filtering-in-the-rendertree</link>
		<comments>http://www.softimageblog.com/archives/262#comments</comments>
		<pubDate>Sat, 24 May 2008 17:48:40 +0000</pubDate>
		<dc:creator>Stefano Jannuzzo</dc:creator>
				<category><![CDATA[Texturing]]></category>
		<category><![CDATA[aliasing]]></category>
		<category><![CDATA[bump]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[normal]]></category>
		<category><![CDATA[texture]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=262</guid>
		<description><![CDATA[The current bump node (formerly known as zbump) became very popular for its simplicity, and for its ability to get procedural textures as inputs.
However, it has some limitations, for instance not supporting texture pre-filtering, and the fact that its spacing is expressed in world coordinates instead of uv coordinates like the old node. This leads [...]]]></description>
			<content:encoded><![CDATA[<p>The current bump node (formerly known as zbump) became very popular for its simplicity, and for its ability to get procedural textures as inputs.</p>
<p>However, it has some limitations, for instance not supporting texture pre-filtering, and the fact that its spacing is expressed in world coordinates instead of uv coordinates like the old node. This leads to frequent aliasing problems, that can sometimes be limited by texturing the spacing based on the object&#8217;s distance from the camera.</p>
<p>Another way of fixing the aliasing is to filter the high frequencies of the input texture. The primary way to achieve this filtering is to do it on the image in an editing program like Photoshop, but this is harder to do with procedural nodes.</p>
<p>However, by using a few nodes in the rendertree, it is possible to do it there also.</p>
<p><span id="more-262"></span>The bump node outputs the new normal (N&#8217;), after having bent the original one (N) based on the texture gradient at the current point.</p>
<p>So, we can compare N to N&#8217; by subtracting them and getting the length (L) of this difference vector (D). Since N and N&#8217; are normalized, and the maximum bump angle is 90 degrees, D ranges from 0 (no bump) to 1.41, ie the hypotenuse of a right triangle with unit catheti.</p>
<p>We can then set a maximum length for D, and re-arrange N&#8217; in order not to exceed it, so to filter off the high frequencies and limit the aliasing.</p>
<p>In this first rendertree, we simply want to check the &#8220;dangerous&#8221; zones. We take the length (L) of the normal&#8217;s difference (D) and check it against a maximum scalar. If this scalar is exceeded red is returned or green otherwise.</p>
<p>In this example the scalar is set to 1, we are seeing in red the parts where the bending angle exceeds 60 degrees.</p>
<p><a href="http://www.xsi-blog.com/userContent/sjannuzzo/2008/05/bf.1.jpg"><img src='http://www.xsi-blog.com/userContent/sjannuzzo/2008/05/bf.1.jpg' alt='' class='alignnone' /></a></p>
<p>To output the filtered normal, we do the same test as above, but connected to a scalar switch.<br />
The switcher outputs the maximum between Max Displacement and L. This value is used to set the new length of D (VectorNormalize + VectorSetLength).</p>
<p>This vector is then added to the original normal N and normalized. This is our new, filtered normal.</p>
<p><a href="http://www.xsi-blog.com/userContent/sjannuzzo/2008/05/bf.2.jpg"><img src='http://www.xsi-blog.com/userContent/sjannuzzo/2008/05/bf.2.jpg' alt='' class='alignnone' /></a></p>
<p>Of course this is a very basic filter, more complex ones can easily be built to fit your needs.</p>
<p>You can <a href="http://www.xsi-blog.com/userContent/sjannuzzo/2008/05/BumpFiltering.scn.zip">grab the scene</a> if you want. The red and green subtree is also included, connected to the shadow port.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=262&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/262/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Colorspaces in XSI</title>
		<link>http://www.softimageblog.com/archives/133#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=colorspaces-in-xsi</link>
		<comments>http://www.softimageblog.com/archives/133#comments</comments>
		<pubDate>Sat, 06 Jan 2007 15:37:21 +0000</pubDate>
		<dc:creator>Harry Bardak</dc:creator>
				<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Texturing]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=133</guid>
		<description><![CDATA[The graphics pipeline from source art to final output is complicated, and requires the artist to work in several different colour spaces along the way. In this article I''ll give a brief overview of colour spaces, and then detail a commonly overlooked area in the texture pipeline where gamma is important.]]></description>
			<content:encoded><![CDATA[<p>The graphics pipeline from source art to final output is complicated, and requires the artist to work in several different colour spaces along the way. In this article I&#8217;ll give a brief overview of colour spaces, and then detail a commonly overlooked area in the texture pipeline where gamma is important.</p>
<p><strong>The sRGB Standard</strong></p>
<p>The sRGB colour space is based on the monitor characteristics expected in a dimly lit office, and has been standardised by the IEC (as IEC 61966-1-2). This colour space has been widely adopted by the industry, and is used universally for CRT, LCD and projector displays. Modern 8-bit image file formats (such as JPEG 2000 or PNG) default to the sRGB colour space.</p>
<p>A value in the sRGB colour space is a floating-point triple, with each value between 0.0 and 1.0. Values outside of this range are clipped. An sRGB colour from this [0, 1] interval is commonly encoded as an 8-bit unsigned integer between 0 and 255.</p>
<p>The pivotal fact to remember about sRGB is that it is <strong>non-linear</strong>. It roughly follows the curve y = x <sup>2.2</sup>, although the actual standard curve is slightly more complicated (and will be listed at the end of this article). A graph of sRGB against gamma 2.2 looks as follows:</p>
<p><img width="545" height="393" src="/userContent/hbardak/colorspaces/srgb-graph.png" /></p>
<p>This mapping has the nice property that more resolution is given to low-luminance RGB values, which fits the human visual model well.</p>
<p><span id="more-133"></span><strong>The Gamma Function As An Approximation</strong></p>
<p>As can be seen by the above graph, the sRGB standard is very close to the gamma 2.2 curve. For this reason, the full sRGB conversion function is often approximated with the much simpler gamma function.</p>
<p>Please note that the value associated with the word gamma is the power value used in the function y = x<sup>p</sup>. Unfortunately gamma is often associated with brightness, which is not exactly what it is doing. The full [0, 1] interval is always mapped back onto the full [0, 1] interval.</p>
<p><strong>What Maths Work In This Colour Space?</strong></p>
<p>In general your lighting pipeline should be done in linear space, so that all lighting is accumulated linearly. This is the approach taken in many film pipeline, and is the only way to ensure that you are being physically correct.</p>
<p>However, assuming that the gamma function approximation is good enough, you can still perform modulate operations. In this case we have some constant A that we wish to modulate our sRGB source data x with, and store the result in sRGB as y. In linear space this would be written as:</p>
<blockquote><p>y<sup>2.2</sup>= A x<sup>2.2</sup> = ( A<sup>1/2.2</sup> x )<sup>2.2</sup></p></blockquote>
<p>Since we are working only in the [0, 1] interval, we can remove the power from both sides and work in the sRGB space itself. In which case:</p>
<blockquote><p>y = A <sup>1/2.2</sup> x</p></blockquote>
<p>So if we convert our constants into sRGB, then modulate operations can still be performed. However, there are only very few operations that work this way. Additive operations (which are used in additive lighting models, or for alpha-blending) <strong>cannot</strong> be reformulated to work in a gamma 2.2 space, simply because the space is non-linear. If you wish to have a correct additive lighting model, then you have to work in a linear space, which will mean that you need a higher-precision framebuffer to at least match the low-luminance granularity of sRGB.</p>
<p><strong>sRGB to linear RGB</strong>: rgb (sRGB), RGB (linear RGB)</p>
<table>
<tr>
<td rowspan="2">R =</td>
<td>r / 12.92</td>
<td>for r &lt;= 0.04045</td>
</tr>
<tr>
<td>( (r + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for r &gt; 0.04045</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">G =</td>
<td>g / 12.92</td>
<td>for g &lt;= 0.04045</td>
</tr>
<tr>
<td>( (g + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for g &gt; 0.04045</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">B =</td>
<td>b / 12.92</td>
<td>for b &lt;= 0.04045</td>
</tr>
<tr>
<td>( (b + 0.055)/1.055 )<sup>2.4</sup></td>
<td>for b &gt; 0.04045</td>
</tr>
</table>
<p>This is commonly approximated as X = x<sup> 2.2</sup> for all channels.</p>
<p><strong>linear RGB to sRGB</strong>: RGB (linear RGB), rgb (sRGB)</p>
<table>
<tr>
<td rowspan="2">r =</td>
<td>12.92 R</td>
<td>for R &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 R<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for R &gt; 0.0031308</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">g =</td>
<td>12.92 G</td>
<td>for G &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 G<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for G &gt; 0.0031308</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2">b =</td>
<td>12.92 B</td>
<td>for B &lt;= 0.0031308</td>
</tr>
<tr>
<td>1.055 B<sup> 1.0 / 2.4</sup> &#8211; 0.055</td>
<td>for B &gt; 0.0031308</td>
</tr>
</table>
<p>This is commonly approximated as x = X<sup> 1/2.2</sup> for all channels.</p>
<p><strong>Ok But How To Do That in XSI ?</strong></p>
<p>Before the release of XSI v6, we could change the ouput gamma of Mental ray and match approximately the sRGB by using a gamma of 2.2 ( put 1/2.2 in the active effect tab). In version 6 this option is missing unfortunately but don&#8217;t worry there are others third party addon that can do the job for you.</p>
<p>I wrote one of them and you can find them <a href="www.harrybardak.co.uk/data/sRGB_utils.zip">here</a>.</p>
<p>This addon include two shaders. A texture node that convert sRGB image in linear space and a lens shader that convert linear render to sRGB color space.</p>
<p>These shader are intended to be used in a context where you don&#8217;t output anything in float format. I didn&#8217;t try it in this context so you don&#8217;t have any warranty.</p>
<p>The idea is to convert every texture that you create in Lin space and convert every render in sRGB space. By texture I mean any images that are not used to drive data such as displacement map, bump map or normal map. I exclude also floating point image which are considered linear defacto.</p>
<p><strong>Let&#8217;s see these shader in action</strong></p>
<p>I will first focus on the lens shader and then on the texture node.</p>
<p>As I said we need to watch our result according to the monitor profile (sRGB) so to convert our render we need to apply the lens shader. It&#8217;s really easy use add it on the lens shader stack.</p>
<p>My first example is simple. A grid with a phong shader and a light. An area light with a realistic falloff. To do this I am using the <a href="http://www.tek2shoot.com/knowledge-base/softimage-xsi/unexposed-mental-ray-shaders-v1.1-32-64.html">D2S_light</a> with a temperature of 6500 K (White). I set the light intensity to get the same result in the red area.</p>
<p><img width="600" src="/userContent/hbardak/colorspaces/physical_light_comparaison.jpg" /></p>
<p>The left picture is rendered as-is in XSI while the other one is rendered with Lin_to_sRGB Lens shader. As you can see the left picture is overlighted. (intensity around 4000) While the right one behave nicely (with an intensity of 750 only).</p>
<p>Note that even the specular from phong shader looks correct. It looks like the reflection of the area light.</p>
<p>My second example is a simple FG scene with 2 spheres and a plane. The plane and one of the sphere got a DGS shader with only a diffuse term set to a neutral gray. The second sphere is fully reflective to see the environment map.</p>
<p><img width="512" height="256" src="/userContent/hbardak/colorspaces/beach.jpg" /></p>
<p>I used an HDR image from <a href="http://www.debevec.org/">Paul Debevec&#8217;s website</a> called beach.hdr to light my scene with Final Gathering.</p>
<p>The first test is a render as-is:</p>
<p><img width="492" height="282" src="/userContent/hbardak/colorspaces/FG_wrong.jpg" /></p>
<p>As you can see the color of the environement map are more contrast / darker than what we can see in HDR shop. To correct this naturally we will change the exposure but the color will be affected and we will got a more saturated image which is wrong.</p>
<p>If we use the lens shader we go this result:</p>
<p><img width="492" height="282" src="/userContent/hbardak/colorspaces/FG_good.jpg" /></p>
<p>The result this time is what we expected. The color match to what we can see in HDR shop. We can start to work safely because we got the right illumination.</p>
<p><img width="512" height="256" src="/userContent/hbardak/colorspaces/0001WM_diff.jpg" /></p>
<p>On my next example I am introducing a texture on the grey plane by plug to the diffuse slot an image node. I am keeping the same HDR illumination and the lens shader.</p>
<p><img width="466" height="247" src="/userContent/hbardak/colorspaces/FG_texture_wrong.jpg" /></p>
<p>As you can see the texture is washed out. This doesn&#8217;t come from illumination. This wood texture has been generated in sRGB color space. With the lens shader we simply apply an another time the sRGB convertion. What we need is to convert this texture in linear space before the render. It is the purpose of the sRGB_to_Lin texture node. Just plug it between your image node and the diffuse slot and re-render.</p>
<p><img width="466" height="247" src="/userContent/hbardak/colorspaces/FG_texture_good.jpg" /></p>
<p>As you can see now our texture is corrected and looks natural.</p>
<p><strong>Bonus</strong></p>
<p>If you need to change your setup and include these two node to your existing setup your can use the existing script written by <a href="/?author=20">Guillaume Laforge</a> and included in the first archive. It will insert a sRGB_to_Lin node after your image node.</p>
<p>If you have any questions, critics or correction please don&#8217;t hesitate : <a href="mailto:harry.bardak@wanadoo.fr">harry.bardak@wanadoo.fr</a></p>
<p>Edit : Gradient example removed because it seams to confuse more people than it helps. Shaders source code fixed I didn&#8217;t realised that this article was read by non XSI users.</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=133&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/133/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Mapping Lights</title>
		<link>http://www.softimageblog.com/archives/107#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mapping-lights</link>
		<comments>http://www.softimageblog.com/archives/107#comments</comments>
		<pubDate>Thu, 13 Jul 2006 19:38:17 +0000</pubDate>
		<dc:creator>Stefano Jannuzzo</dc:creator>
				<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Texturing]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=107</guid>
		<description><![CDATA[Let''s see how it is possible to texture a spot light''s color based on the angular distance from the spot direction.]]></description>
			<content:encoded><![CDATA[<p>The State nodes in the rendertree can easily be used to enhance the standard light shaders. Some of the state information, normally used at a material/texturing stage, have their own meaning when triggered by a light ray.</p>
<p>For instance, let&#8217;s see how it is possible to texture a spot light&#8217;s color based on the angular distance from the spot direction. We just need a few vector math, based on the spot direction and on the point being lit.</p>
<p>First, we need to bring the light&#8217;s position and interest into the rendertee. The interest (Spot_Interest) is a Vector_share node whose x,y,z are linked, via an expression, to the spot interest. The position (State_Origin) is a Vector_state node set to Origin. This stands for the origin of the current ray, the light ray in our case. We could have used expressions to do this but using shaders is faster.</p>
<p>Once the two vectors are subtracted the result is a vector that, once normalized, is the direction from the spot to the interest.</p>
<p>Then, we need the direction of the current light ray. This is provided by another Vector_state node, set to Eye Ray. This nomenclature is incorrect because what the node returns in Eye Ray is in fact the current ray direction, not the eye direction.</p>
<p>If we dot product the two nodes (Vector_math_scalar, set to Dot&#8230;), we have an output ranging [0..1]. In particular,</p>
<p>dot == 0 if the two vectors are perpendicular<br />
dot == 1 if the two vectors are parallel</p>
<p>We just have to use this value to drive a gradient node which then plugs into the light color.</p>
<p><a href="/userContent/sjannuzzo/lightMapping/lp1.jpg"><img src="/userContent/sjannuzzo/lightMapping/lp1.jpg" alt="Light Render Tree" width="610" /></a></p>
<p>Similar techniques can be used to drive the distance falloff (based on the ray length value) as well as other lights attributes.</p>
<p>Have fun!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=107&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/107/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The End Of Cluster Materials</title>
		<link>http://www.softimageblog.com/archives/75#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-end-of-cluster-materials</link>
		<comments>http://www.softimageblog.com/archives/75#comments</comments>
		<pubDate>Mon, 12 Dec 2005 14:33:55 +0000</pubDate>
		<dc:creator>Bernard Lebel</dc:creator>
				<category><![CDATA[Texturing]]></category>

		<guid isPermaLink="false">http://www.xsi-blog.com/?p=75</guid>
		<description><![CDATA[ABSTRACT
This article is intended more as a tutorial rather than technical or idea discussion. In this article I will explore a few texturing techniques to avoid the use of cluster materials.
INTRODUCTION
Fundamentally, putting materials on clusters seem to be the most logical approach to put different materials on a single mesh. For example, when I came [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ABSTRACT</strong></p>
<p>This article is intended more as a tutorial rather than technical or idea discussion. In this article I will explore a few texturing techniques to avoid the use of cluster materials.</p>
<p><strong>INTRODUCTION</strong></p>
<p>Fundamentally, putting materials on clusters seem to be the most logical approach to put different materials on a single mesh. For example, when I came into the world of XSI as a 3ds max user, the first thing I did was to put material on clusters. But that was without considering that the 3ds max workflow for materials is not the same as XSI, and it wasn&#8217;t that long that I faced problems. I changed my ways of doing things, but since then I would often read on forums about people having the same kinds of problems. So I thought I could put a few ideas together and share them with those having these issues.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_01_tobbieRender.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_01_tobbieRender.jpg" alt="Final rendering" /></a></p>
<p>To summarize, my opinion about cluster materials is that from a workflow perspective, they are not good for anything, and from a rendering perspective, they are good only for game production.</p>
<p><span id="more-75"></span><strong>WHY CLUSTER MATERIALS ARE NOT GOOD</strong></p>
<p>Here are few reasons why I think cluster materials should be avoided:</p>
<p><strong>Workflow</strong></p>
<ul>
<li>To get to clusters in the Explorer, it means you have to dig two levels down in under an object. In larger scenes, it will quickly become painful.</li>
<li>Outside of the Explorer, you can access clusters using the F3 key, wich either involves clicking more times down the hierarchy and not having synoptic properties attached, or you can click on the Cluster button from the MCP. Either way it&#8217;s not good enough when you want to work fast.</li>
<li>You can&#8217;t select clusters using a filter in viewports, nor there is a special vibility filter for polygon clusters, even less for those with materials.</li>
<li>There is nothing that identifies the cluster material as a cluster material when viewed in the Explorer. So if you happen to be in the Materials scope, good luck finding to wich cluster this materials attached to.</li>
<li>Worse, if you click on the material icon, it will highlight the entire object (turning its wireframe to pink if you have Highlight Property Set Owners enabled), not just the cluster.</li>
<li>Cluster materials have precedence over the object when it comes to property propagation, and there is no parent-child relationship between an object and its clusters that would allow a branch-select for example, as clusters are considered sub-elements of objects.</li>
<li>Clusters are not visible from partitions, which is a big minus for overrides and materials applied to partitions.</li>
<li>Putting overrides on cluster materials is possible, but convoluted. You either have to group the clusters and add the override to the group, or use scripted operators.</li>
<li>Clusters can&#8217;t be associated with lights.</li>
<li>To make things even worse, when you use cluster materials you will generally use local texture projections as well&#8230;.. productivity just went down to the toilet.</li>
</ul>
<p><strong>Bugs</strong></p>
<ul>
<li>Clusters sometimes render in constant colors, like black or gray.</li>
<li>Sometimes clusters render well but not the rest of the object.</li>
</ul>
<p>If these have not convinced you, then I&#8217;m afraid the remainder of this article will be of little interest for you. But as far as I&#8217;m concerned, a fast and reliable workflow prime over any other consideration, so&#8230;&#8230;. So the next question would probably be &#8220;fine, so what can I do to avoid cluster materials?&#8221;. Actually there are few options available for you.</p>
<p><strong>XSI WEIGHT MAPS</strong></p>
<p>You could use the XSI weight map functionality. Apply one or more weight map on the object, and start painting those weight maps using intensities of 0 and 1.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_02_paintWeightMaps.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_02_paintWeightMaps.jpg" alt="Splitting a mesh using weight maps" /></a></p>
<p>On this picture, I have painted the skin using an intensity of 1, and the rest black. So in the render tree, I would lookup the weight map, connect to a mixer shader, as shown below.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_03_mapLookup.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_03_mapLookup.jpg" alt="The Render Tree setup when using weight maps" /></a></p>
<p>If you have a continuous mesh that you wish to have a clear edge between two different materials, hide the polygons that you don&#8217;t want to paint, and paint the visible ones. When you are done, unhide the hidden polygons.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_04_breakContinuity.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_04_breakContinuity.jpg" alt="Breaking the mesh continuity" /></a></p>
<p>To facilitate the selection of polygons, I usually create a bunch of clusters. If you use such clusters, make sure to not do the mistake of applying materials to them!</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_05_selectionClusters.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_05_selectionClusters.jpg" alt="Using polygon clusters to manage component selection" /></a></p>
<p><strong>COLOR AT VERTICES</strong></p>
<p>Using pretty much the same workflow as XSI weight maps, you can also use color at vertices properties. The advantage of color at vertices is that you can use a wider variety of color, and extract just the color you need in the Render Tree. To do so, lookup the color at vertice, then for each color you wish to extract, connect into a RGBA_Keyer shader. In this shader, set both the Maximum and Minimum Treshold to the color you wish to extract (you must make sure you know the exact RGBA values that you painted!), set the Color if in range to white and the Color if out of range to black. Finally, connect the keyer shaders into the weight inputs of a mixer shader.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_06_vertexColors.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_06_vertexColors.jpg" alt="Splitting a mesh using a color at vertices map" /></a></p>
<p><strong>TEXTURES AS WEIGHT MAPS</strong></p>
<p>You can also use a clever combination of textures and texture projections. Here are a few ways you can do the work.</p>
<p><strong>Multiple mask projections, one unwrap projection, one mask texture</strong></p>
<p>First, create in a tiny texture, say, 32&#215;32. It could even be less. The left half of this texture will be pitch black, the right half will be pure white, this will be our mask texture. Bring that texture into XSI.</p>
<p>For each part of the object you wish to have different materials, you could create a texture projection, and label this projection as a &#8220;mask&#8221; projection.<br />
Now, let say you want to use the same material for the skin parts, and the same material for the clothes parts. You would have two mask projections. In the mask_skin projection, collapse all UVs of the skin parts and put them in the right (white) half, collapse all UVs of other parts and put them in the left (black) half.</p>
<p>Then when you build the final material, connect both materials in a mixer shader, then plug the mask texture in the weight input. In the image shader, choose the right projection.</p>
<p>On the picture below, the clothes shader is placed on top of the skin shader. So to define where the clothes shader will be visible or invisible, I must point the image shader to the clothes mask projection. The UVs of the shirt are placed in the white area, while the other UVs are placed in the black area. So in the end, you could use a Mix_8colors and stack layers of shaders this way.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_07_multipleMasksUVOneUnwrap.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_07_multipleMasksUVOneUnwrap.jpg" alt="Multiple mask projections, one unwrap projection,  one mask texture" /></a></p>
<p>At last, you would need a single unwrap projection for the entire mesh. This projection would allow you to paint the details of the materials.</p>
<p><strong>Multiple mask projections, multiple unwrap projections, one mask texture</strong></p>
<p>Another approach is to have one less projection than the previous method. In fact, the only difference is that instead of collapsing points in mask projections, you will collapse only the points of the parts you don&#8217;t want to see. So each mask texture will not be only a mask, but also an unwrap. Again, you deal only with one mask texture, but instead of having it split in two halves, put everything white, create a 2&#215;2 pixels area at the left bottom corner, and put there the UVs of parts you don&#8217;t want to see. Unwrap the other UVs in the white area.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_08_multipleMasksUVandUnwraps.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_08_multipleMasksUVandUnwraps.jpg" alt="Multiple mask projections, multiple unwrap projections,  one mask texture" /></a></p>
<p>This approach has a significant advantage of the previous one. Because the mask projection is also the unwrap projection, each part of the object can receive a texture of a resolution of your choice, without having to worry too much about the overall texture size. For example, if you want to put a 4k texture for the face and a 1k texture for everything else, nothing is easier. In the previous setup, the only to do that would be to cleverly unwrap everything in one projection so that the face would receive the maximum amount of pixel from the texture.</p>
<p><strong>One projection, multiple mask textures</strong></p>
<p>The next technique we&#8217;ll discuss involves doing only one projection, but carefully painting mask textures. Here, you will create one projection, unwrap the whole object, then paint one mask per part of the mesh. Each of these parts will have to match the UV space it is assigned to. For these textures, you might want to use a little higher resolution than 32&#215;32/64&#215;64, something in the 256&#215;256/512&#215;512 would be more appropriate.</p>
<p>For instance, let&#8217;s take again the skin vs clothes example. You unwrap the whole object. Then you create two masks. In one mask, the area occupied by the UVs of the skin will be white, while the rest is black. In the other mask, the area occupied by the clothing will be white, while the rest will be black. Then again, it&#8217;s just a matter of wiring the right mask in the right weight input of a mixer shader.</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_09_oneUnwrapMultipleMasks.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_09_oneUnwrapMultipleMasks.jpg" alt="One projection, multiple mask textures" /></a></p>
<p><strong>One projection, no mask</strong></p>
<p>The last technique we&#8217;ll check involves doing only one texture projection, and doesn&#8217;t require the use of a mask. On the other hand, all the work of defining the surface properties will be done with the texturing. In this setup, you use only one illumination shader, and use textures in each port to give the illusion of different materials. The advantage is that you do one projection and don&#8217;t have to bother about masks as all, but it means that you have to change the range of many textures since many parameters are not expressed in a 0-1 range as color is. As a result, you may end up with such a Render Tree:</p>
<p><a href="/userContent/blebel/TheEndOfClusterMaterials_10_oneUnwrapNoMask.jpg"><img src="/userContent/blebel/thumb-TheEndOfClusterMaterials_10_oneUnwrapNoMask.jpg" alt="One projection, no mask" /></a></p>
<p>While this approach involves lots of fine-tuning, it has the big advantage of being managed as one single file. In Photoshop, each layer is treated as a single channel of the entire mesh, and lots of tweaking can be done without having to manage lots of files.</p>
<p><strong>CONCLUSION</strong></p>
<p>As we have seen, there are many alternatives to cluster materials, I have proposed a few of them. Just pick the one you think works best. If there are other techniques you think work better, do not hesitate to share them!</p>
<img src="http://www.softimageblog.com/?ak_action=api_record_view&id=75&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.softimageblog.com/archives/75/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
	</channel>
</rss>
