Tuesday, April 2, 2013

Iguana Demonstration

Hello dear readers! Today, you and I are going on a journey; a journey into my texturing process and all its wonders. This journey may be perilous, and not all of you will make it through; but don't let that disturb your calm.



It should be noted that this tutorial presumes a great deal of Photoshop, Maya, and Mudbox know-how; and is not an introductory note to any of them. It focuses not on menu commands and shortcuts but on my overall thought process and how it translates to my workflow. Additionally; this is neither a precise nor a complete look into the whole process, but into those parts of it that I felt would be most interesting.

Without further ado; an Iguana, textured in 19 confusing steps.



First off, the UV stamp in photoshop. The particulars of this layout are not important, since you could use the techniques we'll be using on any model. Uvs will be a big concern for this model; since the character is naked there is nowhere to hide a seam.

I also chose to give him varying levels of symmetry to test this workflow on each; the partial symmetry on the head was fun to work with. Due to the cube-shaped nature of his face, it's not possible to see both sides of his face at once; so those are the only part of his face that are overlapped, leaving the top open to asymmetry.



My first step is generally to take the pen tool and block in the base color of the model. Nothing much to write home about here; but we'll be doing some lighting effects later so pick colors a little darker than your final goal. It's handy to start this way because you can pick out a basic color palette and employ it from square 1. (always aim wide around the UV borders.)


Okay, now forget about those colors for a while. Let's talk about scales. Iguanas have pretty crazy scale patterns, but the bulk of each mass is going to be filled with a pattern of sorts. I started by making a tileable scale image, and defining it as a pattern. Then I filled square chunks with this pattern, converted them to smart objects (in order to deform the layer effect) and used the warp transform to bend them into place.



Here we have the basic scales laid out over the UV shapes. None of the seams match up, but all the inland areas will. The scales on the top of the head are distinctive enough on an iguana that I elected to paint them by hand.



This is where Mudbox comes in. By importing the model into Mudbox, along with the rough scale texture, I was able to paint over the broken seams and patch them up. Mudbox doesn't really like doing that at low resolutions; but after a great deal of kicking it cooperated. Initially the difference between this and the previous step is subtle; but a close-up on any seam area will reveal the important distinction.



At this point, I duplicate the layer and use the Nvidia normal map filter (well worth looking into) to convert the black-and-white scale pattern into a normal map. Making creative use of some blurring and layer effects (strokes, outer glow, whatever speaks to you.) you can get some pretty slick results here. This will come in handy later as the basis for our model's normal map; but that's not actually why I'm making it.

Ordinarily, I would employ "bevel and emboss" (or a hand-painted equivalent) to make the scales appear to "bump" even without the normal map; but a dynamic bevel would struggle to match the distortions and rotations involved in this UV layout, and there are just too many scales to paint by hand.

The model above is lit, with the a normal map applied.

Brace yourself, this is gonna get weird.



We'll start by baking the light onto the model in maya, in this case using the batch bake Mental Ray feature. (The normal map can be a little cumbersome to render with symmetry; but the fixes are all case-specific and best kept for another day.) Try to light it in such a way that the scales each have a distinct highlight and shadow. The model above is unlit, and has the baked light applied as a texture.



Now using the same exact lights, remove the normal map, and bake out the lights again. Those among you frail of heart and uncertain of footing; turn back here.


What I'm doing here is duplicating both light maps, putting the top light map into "difference" mode, and merging those layers. Why? Well this leaves us with a map where white indicates the way in which the light of each scale differs from the global light. What use is that to us?



If I select all, copy the "scaleMask" layer, and apply it as the layer mask for the "scaleTopLight" layer (you can accomplish this by applying a blank layer mask, finding it in the channels tab, and pasting the image in that.) Then, select the mask, and use levels (ctrl+L) to adjust the mask to your heart's content.

Basically; what this is doing is removing the global light from the iguana and leaving only lighting for the individual scales. You can have baked-in global lighting, but too much can interfere with your actual lighting later.

That's one way to do it, at least; here's another way that will yield a slightly different result. Delete the new layers, leaving your original lightmaps.


Duplicate your lightmaps, as before; but this time invert (ctrl+I) the "topLight" layer. (panel 1)

Then, put "topLight copy" into multiply mode, and adjust its opacity until the brighter regions of the texture are grey. (panel 2)

Duplicate "topLight copy" and switch it to "screen" mode, then adjust your opacity until the darker regions become grey. (panel 3)



Done properly, with some help from levels or curves, this can yield a very clean result; and I found the resulting 'bevel' effect had less influence from the global light.

Remember, these two methods are both valid; don't do both unless you want to combine them for a different effect.

With me so far? Good; because you ain't seen nothing yet.


I like to use cooler colors for shadows and warmer ones for highlights. to achieve that result on each and every scale, I selected and copied the "flatScaleLight" layer, created a yellow fill layer, and pasted "flatScaleLight" into its layer mask. Now, the brighter a scale, the yellower. [panel 1]

Next, I took a blue layer, applied the very same mask, then inverted it. Now, the darker a scale, the bluer. [panel 2]

For best results, use levels to sharpen or soften the influence of the color. We won't be using these as you see them here, they'll be much more subtle. You'll see.


Your long ordeal is almost over. Next, I baked out an ambient occlusion map; once again using Mental Ray's batch bake command. Not much to say about it, except that its a good way to add weight and realism to even a simple texture.



Next I hopped back into Mudbox, summoned up the long-neglected base color layer, and added areas of discoloration based on some iguana reference images and my own whimsy. The exact assortment of layers here are unimportant; some are in color mode, some in luminosity. It's a zoo in there. I want to mask them all at once though, and merging them would change their appearance, so I throw them in a group.



And, you guessed it, I mask the group; using a layer mask and some of the vector shapes form when I first blocked in my colors.



That mask is well and good; but I want MORE masking. MORE I SAY. To do this without having to modify my existing mask, I can group my existing group, and apply another mask to it. This time, I copy the layer which contains my mudbox-painted black-and-white scales, apply it as a mask for the group, and blur it a little. The result? Now the color, painted haphazardly, appears to have some relation to the scales themselves.



Alright, we're done setting ourselves up now; it's time to assemble those pieces we made.

First, the black-and-white scales, in multiply mode.  [panel 1]

The normal map you should squirrel away for further refinement, and "topLight" and "scaleTopLight" you can use if you wish; but I delete them here; they're just source layers. [panel 2]

Next, the "flatScaleLight" layer can be put into "soft light" or "overlay" mode, as per your preference. [still panel 2]

The colored light layers I put in a group, and I put that group in "color" mode; effectively "flatScaleLight" will govern luminosity, and "colorLight" will govern color. [panel 3]

On top of all that, put your ambient occlusion into multiply mode. Feel the warm waves of self-esteem wash over you as ambient occlusion makes your art better. [panel 4]



Lastly, our finishing touches. Places like the overlapping spines and claws were treated poorly by all the light baking and have to be replaced completely. You can get a long way just knowing a little photoshop; but in the end you still have to tweak your results to get things perfect. Curves layers, dust and scratches, assorted hand painted details.

That said; knowing how to pull off tricks like this can save you hours in the long run; particularly if you had a whole assortment of lizards to texture all in the same style or something. A workflow like this is flexible, layered, and easy to adjust.

Congratulations, weary travelers, on having survived this lesson in lateral thinking and chronic insomnia.

-alex

No comments:

Post a Comment