This blog describes my journey exploring storytelling - words, images and the sensations they generate. The lot, basically.

Thursday, January 16, 2014

MARI: Distressed painted metal texture from scratch - Part 3

"Start with what is known, and what is hidden will be revealed."  - Rembrandt van Rijn

 

We'll take Rembrandt's wisdom and the approach of building up our textures layer by layer in order create the last of the secondary maps (bump) we need for the jerry can. For the first part of this tutorial, which looks at the diffuse colour maps for our jerry can, please go to http://marquepierre.blogspot.co.uk/2013/10/mari-distressed-painted-metal-from.html and for the second part, which covers the spec maps, please see http://marquepierre.blogspot.co.uk/2013/12/mari-distressed-painted-metal-texture.html.

Imperfection is key to successfully achieving the ilusion of realism and avoiding that computer generated look, and as such wear and tear is an important consideration for a texture artist. Which brings us to the bump maps. When people use the word "texture" outside of CGI, the meaning they refer to is pretty much what we use a bump map to illustrate: The texture of a surface, in terms of bumpiness, roughness and other smaller topographic details in the surface. The bump map adds lovely details, which are mostly only visible when the object is fairly close to the camera. It helps us to break up specular highlights and many other things. In a bump map 50% grey means that the surface is smooth and has neither indentations nor protrusions. White means details that protrudes out from the surface and black of course means details are recesses upon the surface.


Anyway, let's put together the bump map for the jerry can, using what we already have of information in the diffuse map.

To this end duplicate the Diffuse channel and use the duplicate for our bump map. In the Channel palette, right click on the Diffuse channel. Select Copy from the menu. Right click in the empty space on the Channel palette and select Paste from the menu. Now we have a duplicate of the Diffuse channel. Double-click on the new channel named "Diffuse Copy" and rename it to something suitable, like Bump or BMP.

First things first. When I paint secondary maps I set my Mari viewport to 50 percent grey. This allows me to visually gauge how far I am from my 50 percent grey midpoint. Beats bringing out the Color Picker all the time (although that certainly is useful to double-check values with). So right click on any empty and unused part of your Mari viewport. Select Display Properties.
 Under Display Properties, under Background we have two colour swatches, which combined can create a gradient in the background of your viewport. Click each of them (Top and Bottom) and select a 50% grey, and hit Ok.

If you work in flat lighting mode (F1) then you will always be able to quickly compare the values of your bump map against the even grey background of the viewport. 
Building our layers, we want to work from a 50% grey bottom layer - which in a bump map would represent a perfectly even surface. That wil be our starting point, upon which we will add dents, scratches and all the other goodness a bump map allows us to portray. So start by adding a Procedural Layer - Basic - Color and set it to 50% grey. 

So a 50% grey object set on a similarly coloured background, and your viewport should look like the right side (the flat lighting) of this image:

Let's start adding in our details from the creation of our colour map.

The first thing we want to use is the paint on the metal. That paint would sit slightly higher than the underlying metal itself. More specifically, as the green paint layer was a procedural basic color layer masked out in places, we need to use the mask. So right click on the mask symbol and then Layer Mask - Make Mask Stack. This turns our mask into a proper layer, which we can copy and add other layers to in a regular layer stack style.

Also it changes the icon from the mask icon to the mask stack icon:


Now, if you click on the new mask stack icon, a new layer window will open. Select the layer there in and copy it  (right clicking on it, will give you a copy, paste etc. menu). Paste it into our bump channel above the 50% grey procedural colour layer. Create a layer group for it and drag our mask layer into the group. Now change the blend mode for the layer group to Multiply and the opacity to something like that 0.3. This is what my bump map looks like so far:

In summary, what we have done here is creating a difference in height between the paint on the can and the aluminum underneath. Notice that the rubber spout is darker all over. This comes from our original mask, which of course masked away the paint from the rubber spout. In any case, we can leave it for now, as bumps very much work off differences in values. Globally on the spout we right now have a darker value, but the values of the details we will add on top of this darker value will still have the correct differences anyway. Kinda like adding 2 to 0 or 2 to 2, both will give a value which has increased with 2. That is how I see it. Does that make sense?

Moving on...

Move your aluminum base layer to sit on top of what we have so far. Change the blend mode to Overlay and the opacity to something like 0.25. What that does it gently add a bit of variation to our jerry can. Obviously a used jerry can is not completely smooth even on the big swathes of painted metal. We need to break those surfaces up ever so slightly, and preferably in an organic way. Our aluminum base will do this nicely.

Just as we want to break up the even spaces on the metal, so we also need to add a bit of similar detail to our rubber spout. Let's see what we can reuse of existing layers on the spout.

Your rubber base and rubber detail layers could be useful here. I took the rubber base layer and changed the blendmode to Multiply and lowered the opacity all the way down to 0.043. The rubber details layer I used with the blendmode of Color Dodge and an opacity of 0.07. So only adding these details in very, very lightly, but enough to break up the rubber spout, so it will not look like smooth porcelain etc. Here is what I got so far:


Remember our general dirt layer? We used a nice concrete texture to help paint it. As an object becomes dirty, that dirt will also add to the shape or roughness of the object. Drive your shiny new car through a muddy field, and what was previously smooth painted metal will now have bumpy mud on it. On a much smaller scale, we will use that dirt layer to add the bumps corresponding to the information in the colour map. Of this needs to be on a very small scale. Turn on that dirt layer and change the blend mode to Hard Light (as we want both the light and the dark information). I dialed my opacity all the way down to 0.043. You can barely see these details with the naked eye (unless you got a swanky 4K monitor), but with bump maps, little scratches can quickly end up looking like massive gouges in the render, so subtlety is imperative. Here is my bump map at this point:

Speaking of bump maps and scratches, let's move on to this more meaty subject. For the scratches on the can, I want to both use the general scratches we painted and also use a higher contrast version of those. With the higher contrast scratches I want to create a smaller number of more pronounced scratches. So we need to copy our scratches layer and place it in a new layer group. Add on top of the scratches layer in there an adjustment layer - contrast. Adjust your contrast to fit. Here are my scratches post contrast adjustment on their own:


Then change the blend mode of the layer group to Soft Light and the opacity to something like 0.2. Put together with the other layers, this is what it should look like:

That is a nice subtle start to our scratches. Let's turn it up a notch. So if we go back to our original scratch layer, here we will get the majority of the information, which will drive our scratches' bumps. To make sure the bigger details of the texture come out, I changed the blend mode to Hard Mix and took the opacity down to 0.3. In close up, it looks like this:
 
 All told, this is my jerry can so far:

Let's bring in the rust details. Make a layer group for your rust layer, and add an adjustment layer - HSV on top, crank the saturation down to 0. Or you could also add an adjustment layer - Luminosity, which does the same job, or if you are an enemy of non-destructive editing, you could run a filter on your rust layer (Hue or Luminosity for example). You get the point... So with our rust detail all converted to greyscale, change the blend mode of the rust layer group to Color Burn and the opacity to something like 0.236. Now our rust details will have a suitably bumpy surface.
 

Actually. I am still not happy with the way the rust is portrayed bump-wise. I want something more grainy. Rust has that crystalized kind of surface. I am thinking, generate some noise and overlay with the rust bumps we already have to get that grainy feel. Create a layer group and add a procedural layer - Noise - Cellular. Depending on your overall rust look, the noise needs to be quite small. 

Add a layer mask to the rust noise detail layer group and set it to hide all. What I did next was to take a rust texture and using the paint through tool and an organic brush, I painted into the mask where I wanted this noise detail on top of my rust. Here is what I painted onto my layer mask:
Change the blend mode of the layer group to Multiply and take the opacity down to something like 0.227. Up close you can see (compare with the rust bump close up above) the added detail provided by the noise layer:


That takes my bump map to its final stage:

Which rendered out, contributed to this look:


In my final instalment of this mini-series, I will go over setting up our shaders and lighting. Then I am looking forward to seeing your renders of this simple Mari texturing project.




Did you find this useful? Leave me a comment, share the post via your favourite social media or drop me an email about things you'd like to see covered.



Friday, December 13, 2013

MARI: Distressed painted metal texture from scratch - Part 2

"Start with what is known, and what is hidden will be revealed."  - Rembrandt van Rijn

 

We'll take Rembrandt's wisdom and the approach of building up our textures layer by layer in order create the secondary maps (bump and specular) we need for the jerry can. For the first part of this tutorial, which looks at the diffuse colour maps for our jerry can, please go to http://marquepierre.blogspot.co.uk/2013/10/mari-distressed-painted-metal-from.html

The spec map is often considered the most-valuable-player of all the texture maps. When objects are so far away from the camera, that the diffuse map cannot be made out anymore, you can usually still see the effects of the spec map. The opposite end of that spectrum would probably be bump maps, which are the first to go as the camera pulls away from a model. The spec map will simply put control how shiny our object appears; how much of the light that hits the object is reflected back. Black equals the light-eating power of a black hole, where white equals the mirror shine of chrome.

Anyway, let's start putting together the spec map for the jerry can, using what we already have of information in the diffuse map.

To this end we will duplicate the Diffuse channel and use the duplicate for our spec map. In the Channel palette, right click on the Diffuse channel. Select Copy from the menu. Right click in the empty space on the Channel palette and select Paste from the menu. Now we have a duplicate of the Diffuse channel. Double-click on the new channel named "Diffuse Copy" and rename it to something suitable, like Spec.




In the Layers palette for the new Spec channel, add an HSV adjustment layer as the top-most layer of the stack. Take saturation slider all the way down to 0, and now our duplicated diffuse channel is all greyscale as a spec map needs to be.Turn off the visibility (click on the little eyeball icon next to each layer) of all the layers in the channel, and then we will bring them in as need be.

Add a procedural layer (Basic - Color), set the colour to black (don't use complete black, or white in your textures, it messes up the shader math); put 0.114 in each of the RGB channels.

This "black" will be a base for the rubber spout of the jerry can. So why don't you add an empty layer group and drag the procedural color layer into the group. Add a layer mask to the group by selecting the group, right clicking on it and selecting layer mask - add mask. Whether you go for Reveal All or Hide All, paint with pure white or black in your layer mask, so only the spout is affected by the procedural color layer. For good measure, I have added a white color layer underneath to help our spout to stand out.

Other than the procedural layer with the black colour, which we have just inserted at the bottom, your lowest layer should be your aluminum base layer. We need that. Click on the eyeball left of the layer in the layers palette to toggle its visibility on. The aluminum texture will both give a nice neutral base to build upon as well as lot of organic details and variation, which suits a metal can. So far, so good.


Next I want to add a touch of ambient occlusion. In corners dirt and dust will gather automatically due to inaccesability, which makes it more unlikely to get wiped off by regular use. Most kinds of ordinary dust and dirt will lower the shininess of a surface, so using ambient occlusion to make these areas darker works well (darker is less reflective or shiny in our spec map, mind you). A tiny touch will do.

Click on the Add Procedural Layer button in the layers palette. Select Geometry - Ambient Occlusion. Set the blend mode of the layer to Multiply and the opacity to 0.150. If you don't have something like this...


... it might be because you haven't calculated your ambient occlusion yet. In that case, select your jerry can as an object. Go to the Objects menu and select Ambient Occlusion. Mari will calculate for a while, and then you will have your lovely ambient occlusion.

Remember your Dirt layer? Turn that back on (click on the eyeball to the left of the layer name). This is what I have:



Next we want to bring the scratches back into play. If memory serves, the scratches layer from the diffuse map was set to Hard Light blend mode and 0.798 opacity. That should do nicely for the purpose of the spec map as well, so turn the layer's visibility back on.


 
The spills we added from down the front from the spout and to the base of the can also need to be in the spec map. However, they were set to Vivid Light blend mode before and 0.552 opacity. Change the blend mode of the Spills layer to Overlay and crank the opacity up to 1.0. Which should look something like this.
Lovely.

Onto our Dust_broad group. Therein we painted a broad and generic dust layer, masked by Ambient Occlusion. Turn the visibility of the Dust_broad layer group on. We should be able to use the blend mode (Overlay) and opacity as is. So far, so good:




We also have the Dust_detail layer group, where we added more specific dust around the base of the spout etc. Turn on the visibility of the Dust_detail layer group and make sure the blend mode is set to Overlay and full opacity.



I am looking at our spec map and I would like the scratches to be more pronounced. As light moves across the jerry can, the scratches would be a very distinctive feature. Aluminum has a dull glow, as the surface is oxidized over time, also you have the paint, which obscures metal, but where the scratches are, the aluminum will be naked and in some places freshly scratched - revealing the full extent of its shininess in places. Copy the Scratches layer (Right click on the Scratches layer and select Copy and then right click again and select Paste). We still want all the light and dark information of those scratches cranked up to full effect, so blend mode should still be Hard Light. I further took the opacity up to a full 1.0. 


So that is the scratches. How about rust? How does rust affect specularity? In my experience, rust dramatically dulls the reflectivity of metal. What is least shiny thing you know? From where I am sitting, the carpet underneath my feet has next to no reflection. Rust is pretty close to that. Do a quick google search for rust and you will see that there are a lot of different types of rust, which again would mean a lot of different looks of rust. Of course it not completely diffuse, but close, and so we aim for darkness where we have our rusty patches.

Our rust layer was set to multiply. Turn on the visibility and crank up the darkness it leaves by changing blend mode to Color Burn. It should look something like this...


Zooming close in on the rust, I love the grainy details. Rust is never very even in its colour, density and distribution. That should correspond nicely with the crystalline quality of the surface of rust.


The very last addition to our spec map will be our grime layer. Turn the visibility of the Grime group on and change the blend mode to Color Burn. I want this layer group to help create break-up and variation of the larger metal surfaces, so we need Color Burn's increase of contrast to help with that. Change the opacity to something in the range of 0.25, which gives us our finished spec map:



Now that we are done, going back over the project, a few things could be improved. Perhaps we could add just a touch of noise to the rubber spout base, to further break up the base (apart from what we have done with the layers of dirt, dust etc.). We could also make a differentiation between the exposed metal and the painted metal.

In general it is worth noting most, if not all, of what you need for your spec map, you should already have in some shape or form in your diffuse (colour) map. Also, a spec maps best friend is variation. So if you have large stretches of the same material on your geometry, make sure you consciously look to break it up in your spec map. Unless your object is fresh from the factory, this is a really key point. On a show I worked on, we had a number of spaceships, which needed to appear relatively clean and sci-fi'ey, but as a result the colour maps were struggling a bit to convey the needed realism - solution? Quietly make your spec maps absolutely filthy...
 
What is left now, is just to create a bump map and setting up our shaders and lighting. That will be the topic of the last two posts in this mini-series. Then you should have a render looking more or less like mine:



This tutorial continues with an overview of creating a bump map for our jerry can here.
Did you find this useful? Leave me a comment, share the post via your favourite social media or drop me an email about things you'd like to see covered.

Saturday, November 02, 2013

/Shameless Plug/

Ladies and gentlemen of the public,

Could I please prey on your patience and good nature for a moment:

Remember the stylized KFC commercial, I was using as an example for cartoony texture painting?


Of course you do.


That short is nominated for an award by Animae Caribe. Could I ask you, please, to direct your browsers to http://www.animaecaribe.com/vote-commercial?and vote for "KFC 40th Anniversary"?

I would be eternally grateful and happy to reciprocate with a solid favour, whenever you need one.

Thank you kindly!

Friday, October 11, 2013

MARI: A walk on the wild side - stylized texture painting

I think the one tool, that made Mari what it is to texture painters today, is the Paint Through tool. Secondly, you could mention the ability to handle hitherto impossibly large amounts of image data with ease. Seldomly does the basic Paint tool get to be front and centre to what we do as texture artists. I call myself a Texture Painter. I paint in my spare time. Oh yes. Brushes, canvas and paint in tubes. No school, like the old school. But that has little to do with 98% of the work you can find today as a texture artist. Sadly.

Recently I was approached to paint textures on an animated short celebrating KFC's 40 year anniversary on Trinidad & Tobago. Yes, paint textures. Not project photos. Being a huge fan of stylized cartoon animation, I leapt at the chance. For this particular project Producer Nicholas Maxwell and Director Adrian Nurse wanted something stylized and painterly with visible brush strokes. A point of reference was the excellent Meet Buck by the Steak Kollective.


Analyzing the look of Meet Buck a few things stood out. Comparing the two projects, we were not going to have exactly the same lighting setup, but in terms of textures there were a couple of things we could run with; I deduced the following basic rules, which served as a guide to unify the look of the textures in our short:

  • First pick a base colour - the local colour of the object
  • Take that base colour and change it into two variations: One slightly lighter and one slightly darker - both with a slight change in hue as well. These two will serve to break up the base colour, add visual interest and take it towards that painterly look. To that end, it is important that these two colours are so different (both in terms of hue and value) that the brush strokes can be seen, but not so different that the brush strokes will appear noisy or jarring.
  • Use a brush on reduced opacity, in order to build up your brush strokes as you go. This allows you to get a lot of mileage out of the relatively few colours you work with. (My go-to brush was basically feltTip from the basic brushes tab set on 0.350 opacity.) By mileage I mean that instead of adding the necessary variations in colour and value to your textures, which is needed to add richness to that organic painterly look, by picking umpteen different colours to paint with, adding brush strokes on top of brush strokes for different combinations of opacity, will give you those levels of variation you need.
  • We needed to paint a fair bit of light and shade into the textures. Working again from the base colour you pick a colour of a slightly different hue and a good bit lighter or darker. These are used to paint in light and shade, as well as in places help shape the model by suggesting details in the geometry.
  • In addition to this, on the face of hero characters you want to add the classic golden (from forehead down to eyebrows), red (from eyebrows to tip of the nose) and blue (from bottom of the nose to the chin) zones of the face.  
  • Finally, as this animation would include the actual likeness of the KFC founder Colonel Harland Sanders, we couldn't quite push the style as far as Meet Buck. 
Repeating these five steps created a tight recipe, where assets could be turned around fast and with a uniform look.

This little story consists of a young boy and his father over the course of the 40 years KFC has existed on Trinidad & Tobago. They grow and age together, with local historic events from the past 40 years in Trinidad & Tobago as backdrop. The animated short was split into a 15 seconds teaser and a 45 seconds full short.

Before we dive into how the individual textures were made, I have to give credit to all the rest of the team, from the brilliant backgrounds from Victor Georgiev, and the animators breathing life into the characters, to the lighting and shading by Vanessa Thieffry and the compositing by Adrian Nurse.

Since this is a story about fried chicken, let's start with a drumstick prop. Sharing my work in progress with another long-time texture artist we marvelled at the opportunity to paint a piece of fried chicken; Doesn't happen every day. Or ever, to most texture artists.

So you start by blocking out the colour of the drumstick. This colour was sampled from a photo reference of a fried piece of chicken. Simple.

Then you bring in a darker variation of your base colour and add some variations to the base. At first you literally just lay down random brush strokes to break up the base. Once the first few brush strokes have been put down, you can do more conscious ones. It may not look like much so far, but keep the faith and follow the recipe and we'll get there.
Then you add a colour lighter than the base, again for variation, and again your first strokes will be randomly placed. There are no blend modes or opacity changes involved. Just each colour on a separate layer and lower opacity (between 0.2 and 0.3) on your brush.
Now we have a nicely varied base. Time to help shape the drumstick a bit. For clarity, this is the mesh with full lighting:
First you pick a lighter colour and paint in the peaks of the geometry:
Then all that is needed to finish up is a darker colour to paint in the recesses of the drumstick.
Finished... One piece of crispy fried stylized chicken. Enjoy!

To recap, please note that I have changed the hue of the colours I work with on each layer. That as well as the lower opacity brush, I think are the key parts to building that variety which is needed to sell a painterly look.

Let's try this on for size on a character. Here is the mesh of the (youngest version of the) father character:


So you start by blocking in the colours (please excuse the intersecting mesh in the eyebrows):
Then we add lighter brush strokes to break up the base. Notice again their fairly random placement.
Similarly with darker brush strokes. Here I have in places used the darker brush strokes to shape the model a bit.
Adding in stripes to the shirt (a basic HSV adjustment layer with a mask, shifting both hue, value and saturation to fit) and stitches to the jeans (simple paintable layer with no blend mode nor opacity changes).
Next I am adding blue colour variation to the "blue" portion of the face (see above). This layer is set to 0.100 opacity, but still normal blend mode.
Similarly adding red colour variation. This layer is set to 0.150 opacity and Overlay blend mode.
Finally the golden colour variation on a layer with Overlay blend mode and 0.300 opacity.
Before I continued with my formula, I needed to add a bit of detailing to the lips:
Then we start shaping the model with the painted light.
And similarly with painted darkness.
At this point I wanted to bring the lips out a bit more. So an HSV adjustment layer with a layer mask did the trick.
Finally a touch of Ambient Occlusion to help further bring out the shape of the model.
At this point the client asked for changes in the value of the father's skin tone, so the final textures ended up like this:
And here is the father in all his lit, rendered and composited glory:


By far the hardest asset to get right, was also the most important: Colonel Harland Sanders from KFC. It was daunting to get his likeness right, but at the same time keeping him true to the art style of the rest of the film. Regardless, I set out determined to see how far my "recipe" could take me with the Colonel.

I was helped greatly by the model (please excuse the intersecting polygons in various places). Already a good likeness was there:
So I blocked in the colours. How do you paint a white shirt inside a white suit? Pure white is of course anathema to texture artists. I decided on playing with very light pinks, blue and crèmes to create the illusion of the white suit.
For this model, I thought I would need some additional colour variation in his skin. Please again note the seemingly random brush strokes. Yes, there is such a thing as 'happy mistakes'!

Then comes the light brush strokes for variation of the base colour.

And the dark ones...
Then I begin to shape the colours of his face. First I add blue from beneath the tip of his nose down to his chin. This layer is Overlay blend mode with 0.150 opacity. Easy does it; we only need a hint of blue.
Next is a bit red across his cheeks, nose and ears where you have a lot of blood vessels close to the skin. I am using Soft Light and 0.250 opacity on this layer.
And finally a touch of gold across his forehead. Overlay with 0.200 opacity.
In my reference photos of the Colonel, I noticed that he had a fair bit of pink across his cheeks and nose, as older white people often do. To wit, I added a layer with some extra pink goodness for the Colonel. This sits on a normal paintable layer with no changes to blend mode nor opacity.
Now it is time to separate the men from the boys. Painting light into the textures will very much determine whether the final textures will look like the Colonel or just some overworked mess.
Similarly the painting in shade very much brings out the features of the Colonel. It was a fine line to not overdo the dark lines - on one hand he needed to look like the aging Colonel, on the other hand he could quickly start looking like a bad rubber Halloween mask.
Finally a touch (0.200 opacity with Multiply blend mode) of Ambient Occlusion to round him off and tie everything nicely together.
Here is the Colonel with the concept art and reference photos I used.

And in all his rendered glory...
All told, I am pretty happy with the outcome. Any texture painting geeks who want to inspect the flats? Okay then. Here is the Colonel's face:
and his trousers, shoes and hair:
You can view the 15 second teaser here.

When we started on this project, I had some doubts whether Mari would be the best suited tool for a job like this. I knew that the Steak Kollective guys had used Photoshop for the textures for Meet Buck. I have always admired the very painterly output you can get from Painter, with its excellent ability to mimic real world art materials and surfaces. However Mari was more than up for the task. Mari was clearly created for VFX use, but in my opinion its toolset goes much further than that.






Did you find this useful? Leave me a comment, share the post via your favourite social media or drop me an email about things you'd like to see covered.