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

Saturday, January 14, 2012

Tutorial: How to Paint Textures the World of Warcraft Way

During the course of the thesis project of my bachelor study at University of Teesside, I experimented with putting together a World of Warcraft style outdoors environment.

Over the course of this project I developed a particular methodology for painting my textures. This ensured both a fairly consistent output, but also helped as a paint-by-numbers backbone when I was stuck on a particular task, or uncertain about how to begin it. Once all these guidelines had been checked off, I would have a product, which was so near completion that it would be easy to make out which parts were still missing. Or as Rembrandt so wisely said, "start with what is known to you, and what is unknown will be revealed."

Though this is all the way back from 2004, perhaps it might help a few people out there.

So here we are in Photoshop looking at how to organise our layers and progress them logically till we have the desired look:

My first layer in Photoshop is a sketch layer. 

1.1 The sketch layer (left) for a grass texture, along with the final texture (right)
With quick and simple brush strokes I lay down a rough design for the texture. The sketch layer will not be seen in the final texture at all, so precision is not paramount. It is more about trying to lock down the composition and placement of the different elements. Also it is a subconscious warm-up for the artist, where you can doodle your way into the world of the material you are about to create. Depending on the type of texture and the projection and UVW coordinates, it is a good idea to save often, and then load up the object in 3D space with the unfinished texture mapped on. This gives the artist a chance to make sure the different parts of the texture is placed correctly before too much work would have to be redone or edited. 

For textures where a solid template has been extracted from the geometry, you often don’t need a sketch layer, if the UV template is self-explanatory. Here the template layer serves as its replacement to offer the proportions and shapes of the final texture. 
1.2 Templates laid out on the canvas
After the sketch layer, it is time to lay down the major colour values. For that I will create a base colour layer for each of the separate objects or fields featured in the texture. In turn each object or section will be organised in separate layer sets, appropriately named for ease of navigation as well as organisation of screen real estate. On the base colour layer a fairly accurate estimate of the materials average surface colour will be painted in with a decent amount of precision. 

Following on from the base colours, the details will be painted in, in a similar fashion, on a layer above the base colour layer. The main objective here is to lock down their shape and general colour. 
1.3 Base colours blocked out
Once we have these, the most prominent colour values painted into the texture, it is time to think about the texture of the surface of the object we are creating a material for. What would it feel like, if we were to run our fingertips over it? Rough or smooth? Is there a particular pattern to the texture of its surface? 

Take polished wood from a tabletop for example. There you will have a very smooth surface marked with tiny grooves, which all run more or less parallel, and furthermore form a pattern of elongated rings. Once a suitable texture has been found as a reference photo or painted from scratch, I will usually set this layer’s blend mode as either multiply or hard light with around two thirds worth of opacity and fill. This will allow the texture layer to mesh nicely with the colours of the base and detail layers, as it increases the contrast between brightness and darkness of the colours below in the pattern of the surface texture.
1.4 Patterns added to the texture
The next layers I work into the stack are some I personally refer to as my curvature or dimensionality layers. What I want to add to the image now, is the illusions of depth. 

try to illustrate the curvature of the surface by creating a light and a dark curvature layer. The first one is the “curvature dark” layer where I, with a loose hand, will paint broad and slightly transparent lines of dark and desaturated purple. Usually the brush settings are not more than 20% opacity, to make sure that I can build up the effect I want in an organic way, by painting over and over till the desired colour depth is established. The idea is to make the parts of the surface that are the farthest away from the viewer the darkest, and vice versa. I do the same with “curvature light” layer, which I place on top of the “curvature dark” layer. Here I use the light yellow to illustrate where the surface of the material protrudes out towards the viewer. 

These two layers will then be taken through the Gaussian blur filter in Photoshop to smooth them out, and make sure the painting is not too conspicuous. Furthermore I lower the opacity to no more than 50% and might even take off a bit of the fill rate too. For the dark layer I usually use the multiply blend mode, and for the light layer, I use the lighten or soft light blend modes. 
1.5 Dimensionality layers in effect
Already now, after these few crude operations we have a decent texture quickly emerging. It has an illusion of dimension and depth. It has an illusion of a surface texture native to the material we are trying to describe visually. It has a good estimate of the correct surface colour. There are still a lot more that can and needs to be done, but after these few fundamental manoeuvres we are well on our way. 

A good technique is to make sure your edges are marked out. Corners which points away from the viewer and other crevasses in the texture, I line with a dark colour, typically dark purple, on a low opacity layer with multiply blend mode. Corners which points to the viewer or edges where the material portrayed ends, I line with a light colour, like light yellow, on a similar low opacity layer with a fitting blend mode. That can be anything from colour dodge to overlay, depending on the situation. The illusion that we are trying to create here is, that at the very least, tiny amounts of dirt will gather in grooves and corners, which will obscure and darken the colour underneath substantially. Likewise protruding edges have a tendency to reflect light in a different fashion than the flat surfaces adjacent to them. This we are trying to illustrate with the lightening effect. Both layers will need to be slightly blurred with the Gaussian blur filter. 

Apart from illustrating changes in local colour from additional wear on edges protruding out and collection of dirt and dust in corners and crevasses, this step is also a bit of cheap and dirty ambient occlusion, where we are painting a touch of lighting information into the texture.
1.6 Edges and corners painted in
If the texture we are painting is for an object that resides outdoors, it needs to show the effects of weathering, or if it is placed by windows where sunlight will regularly bleach the surface, it will need a similar effect. For that we need to desaturate the colours where sun, wind and rain have washed them out. For this we paint with a light grey where we want the desaturated effect. Again the brush needs to be very transparent, around 20% or so, and I find that broad strokes work well for this effect. Generally in texture work, textures will need to be far more desaturated than you think at first, in order to achieve a realistic look. But since this is the highly stylized look of World of Warcraft, we don't need to go to those lengths.

When I am happy with the areas covered I change the blend mode to colour dodge and lower the opacity to around 70% to brighten up the area. Then I copy the layer and change the blend mode of the new layer (sitting on top of the old) to saturation. And the weather-worn effect is finished. 

Another effect of being left outside could be long-term exposure to moisture, which will leave green algae or lichen on the material. Such effects I usually conjure up with a noise filter, and then setting my blend mode to soft light and reducing the opacity with a good 20 percent. 
1.7 Residue of green algae added to the bottom of the bucket
Most any material, which has not just left the factory line, will have scratches, cuts and wear of different kind. So we analyse the material we are portraying, and make out where scratches and tears would gather with normal use. These I usually paint with a dark thin brush. I will then add the layer style outer glow to them, and use the default light yellow glow in overlay blend mode. To use a lighter outer glow, gives the lines a subtle addition of contrast, so they will stand out more. Furthermore the light edges on them will simulate the same effect we did when adding light edges to the corners that are protruding. Then I select the contents of the layer with the surface texture and delete that selection from the scratches layer. This lets the scratches be embedded into the surface, by following the closely the texture of the surface. 

1.8 Leather shield without scratches (left) and with scratches (right)
If the texture has areas with paint, enamel or other materials covering the surface, you need to make sure that the scratches will be etched into the paint. So I select the outline of the scratches and the wear and tear and delete that selection of the paint layer. After that, it can, in many cases, be beneficial to add a bevel and emboss layer style to the paint layer. Just a few pixel thick it will give the illusion of dimension in the paint layer; that the paint is actually added on top of the base surface, instead of it being assimilated completely into the material underneath.

1.9 Painted leather shield with scratches etched into the paint
Where the material has overlapping objects or other things that will cast a shadow on the surface beneath it, we paint lines of dark purple with a soft edged brush. It is a good practise to build up the wanted result layer by layer, by setting the opacity of the brush as low as 20-30%, and then keep painting over and over and over again, until the desired result is there. This allows for a free and painterly style of working, where you leave room for “happy mistakes.” Then the layer is blurred with the Gaussian blur filter, and finally the blend mode changed to multiply and the layer’s opacity lowered to around 30-40%.

1.10 Shadow cast by the rope is added
One of the last things left to do now, is to paint highlights with a light shade of colour, usually a light yellow in this colour scheme. The highlights go where light will bounce off the material; where the material is shiny and smooth; and where the materials protrude out towards the viewer. This is done with a brush of a fairly low opacity, around 20-35%, and then blurred with the Gaussian blur filter afterwards. I set the blend mode to screen and lower the opacity and fill rates to around 60%. 

As the texture is almost finished, I like to go back to my base colour layers and pick out two or three shades of colour analogue to the base colour underneath. These I paint on separate layers in a quick and semi-random fashion with a soft edged brush with no more than 15% opacity. The blend mode stays as normal. This is used to give the colours underneath a more crisp and lively feel. The last thing you want is a flat and completely uniform field of colour, even if that is what you are aiming for. This sounds contradicting, but even if a face of colour is perceived as being uniform, there will always be subtle variations, without which it would not be perceived as real or normal looking. Furthermore with an understanding for colour theory, the base colours can be enhanced immeasurably this way. Take a green for instance, put a light yellow on one side of it, and a purple on the other, and it will spring to life and appear much more crisp and sparkling. 

1.11 On the left the wall is without analogue colour differences, on the right it has the differences painted in

Lastly I want to make sure that no surface, detail or anything else is too uniformly coloured. So my topmost layer consists of very subtle colour noise. This is made by using the filter render clouds on an empty layer with the default setting of white and black for foreground and background colours. Then I switch to the channels palette where I will repeat the same filter in each of the red, green and blue channels. This secures a random distribution of red, green and blue, which will show as a harlequin kind of pattern on that layer. I change the blend mode to soft light and decrease opacity and fill down to at least 40. In some instances you need to go as low as ten. This makes sure that a random pattern of the RGB colour hues is softly changing the underlying colours to break up overtly monotone fields of colour. 

1.12 A colour noise pattern
Notice that one of the absolutely crucial effects needed to conjure forth a realistic texture, dirt, is seldom needed in a cartoony texture. Normally you would use a dirt layer messing up the hitherto so tidy material, typically with a multiply blend mode. But that effectively ruins most stylised looks. 

At this point I have a decent texture, which oftentimes only needs minor tweaking. In the worst cases the details or changes needed, will be apparent at this stage. If the texture includes ornamentation or other decorative details, they can easily be added now, on top of a very believable surface, which will constantly remind you of its make and condition. 

1.13 The finished texture

1.14 The finished texture applied to geometry and rendered out

No comments: