Downloaded from www.biorust.com on Tue Feb 07, 2012 11:01:55

 
The Pattern Maker
Tutorial Author - Elentor (mailto:fpires.arts@gmail.com)

The Pattern Maker plug-in that comes with version 7.0 and greater of Photoshop is arguably one of the most powerful tools ever to aid 2D Artists. It is so absurdly easy to use, and produces such great results, that it has quickly become very popular amongst texture developers. Let's see why.

Notice: This tutorial is advanced in nature and expects that you already know the basics of Photoshop. Also, since it's focused on texture-making, I will be using another piece of software, called Rhinoceros, to show the textures on a 3D plane. It's obviously not needed for the tutorial, but since this is texture-biased, I think you can achieve the true objective of this tutorial with a 3D program of your choice, such as 3D Studio Max, Maya, or Cinema 4D.

Step 1 - Getting Started...
The first, primordial base of every patterned texture is a good photo. Yup, really - unless the texture can be easily recreated with filters or brushes you should stick to ripping it from a photo. I recommend searching using the image directory features of Google. If you are going to work on a professional, commercial project, then you need to get yourself a good digital camera! ;). Ok, seriously, I recommend that you get a camera either way, because the ability to take your own photos gives you a creative freedom that will enhance your work greatly.

With this in mind, I'm going to start this tutorial assuming that you DON'T have a camera, and need to derive your textures from pre-existing photographs.   So, without further ado, load up the image directory on Google and type "grass" (ideally filtering out everything but the largest images - you can define these restricted search parameters in the preferences section). Choose an image that you like and load it up into Photoshop.  I picked this one:



Step 2 - Selecting The Ideal Area
Ahh! There's nothing like virgin, beautiful grass for us to work on! Okay, the trick is as follows: You have a big image and need to pattern it. The first rule is that you cannot, under any circumstances, simply select the entire image and then run the pattern maker. Patterns must be seamless, without any artefacts. You must select an area that seems to be free from distinct objects, and capable of generating a decent pattern. I have, therefore, selected this area to test:



Step 3 - Pattern Maker Options
Run the Pattern maker after selecting it from the Filter menu. Now, just some tips before we actually make the pattern:

  • Click the "Use Image Size" button. It's actually much better to fill all the canvas with the pattern than just a small selection while testing it. Trust me.
  • Since this is a texture, you should ideally do your final work with potencies of 2, for better compatibility with some engines (Crystal Space, for instance, can ONLY work with potencies of 2). By potencies of 2, I mean ensuring that your image sizes are divisible by 2 whilst maintaining whole numbers - i.e. 16px*16px, 32px*32px, 64px*128px, 512px*256px, 256px*32px, 512px*512px, etc.
  • Ignore the "offset" dropdown box. It's very useful for some kinds of tiles, but these are not an aspect of our project.
  • Now, onto what I believe that are the two most important options: Smoothness and Sample Detail. Smoothness can have values of 1, 2 or 3 - each one being a degree of smoothness in the transitions between each of the "random pieces" inside the pattern. What the plug-in does is simply cut random parts of the image out and blend them together. Smoothness let's you adjust how smooth this blending will be expressed. There are some tricks to this: Smoothness level 1 is completely "jagged" and does a really dirty job. Smoothness level 3 is usually very blurred and can smudge most of the detail out of the texture. Smoothness level 2 takes the middle road.   You will find that there are situations which require you to play around with the smoothness value a lot. While you will stick with 2 or 3 usually, a Smoothness level of 1 works great for grass.
  • The next definable option is sample detail, which works in much the same way as smoothness. The trick is as follows: The higher the sample detail, the "smaller and more detailed" the tiled cut-out images will become. This will, of course, have direct implications for the repetitiveness of the final pattern. I usually stick with low sample detail values because they work better on textures.   The lowest S.D. value is 3, whilst the maximum is 21.   I always fluctuate between 3 and 8, and very rarely use S.D's of 14 or 16. For grass, the best choice will be the one that results in lower sampling detail - it will just look more "grassy".   For this reason, I chose a sample detail value of 3.
Now it's time to see our results!



Step 4: Looking good? Well, not really...    To see why, lets resize the picture and add it into our 3D program to get a better view.


Step 5 - Detecting Irregularities
Can you notice what is wrong? Well, let me tell you: The most ironic characteristic of a high-quality pattern is that it simply cannot have any pattern. Complex textures can't LOOK like patterns - they must resemble something completely natural, fresh, and asymmetrical. To clarify these points, lets look at our texture in a 3D package:



Step 6: Now, that is what I would call a nice sample of a magnificent grass texture and... oh, wait, what's this?  Ah-ha! This is the problem. See these black, darkened shapes and forms? This, my friend, in terms of game industry, is a big NO-NO!   Imagine seeing these artefacts repeated dozens of times while looking at the grass. If seeing them repeated 4 times is already bad enough, imagine seeing them spread infinitely across textured hillsides - Now that's GOTTA be disturbing!

Step 7: I have selected "artefacts" in the image to show objects that can ruin the end result. The upper area is full of these darker areas, and there is a weed in the circle that can completely destroy all chances of getting good patterns. The lower area also expresses a different contrast than the upper area, which can mess things up further.  There are two options open to us - We can just select a smaller area, or clean the image up using the Clone Stamp tool. This will only take a few moments, after which you should run the pattern maker again. The corrected texture should come out looking a little like this:



Step 8: Nearly there! There are still some small patterns on the grass, but by now they are so small that you will be able to clean them up with strategic use of the clone stamp in the final texture.

NB. If you are developing for a gaming engine, you should really copy the texture and re-run it in the pattern maker with a potency of 2, and an overall size of 256px*256px.


Step 9 - Its a Long Road
We now need to get down to making a road. Yep, a road!  And since we're going to make a road, we should really find a nice dirt texture. Again, you can just type "dirt" on your favourite image search engine and pick a result you find interesting. I'm going to use this one:




Step 10 - Its a Longer Road!
So... a nice image of dirt.. and rocks. Creating a texture out of this image can be pretty challenging due to the high number of objects in the scene. You can choose to select the few, non-rocky areas, like the region in the top-left, but the end result will probably suck. Furthermore, smoothness values of 2 won't work, neither will 3, so you'll be sticking with 1 again. The right area is full of big, evil rocks whose only intent is to ruin this image for our tutorial. Not only that, but with so many diverse objects in the image, even in the clean area, you will notice if you start playing with the image that most will generate textures with large expanses of evil artefacts and repeating patterns.

What can we do? Well, look at the left side. Tons of smaller rocks add an overall diversity to their area, and make this region ideal for our purposes.  The only problem lies with big rocks and the darker shadows. They can generate annoying patterns. Again, the Clone Stamp is our salvation. Obliterate those bigger rocks and shadows and you should end with a result like this:

Step 11: Use a resolution of 256px*256px, a smoothness of 1 and an SD of 5.   Click repeatedly on the Generate button until you find a result that looks ideal. If necessary, you can always clean up the resulting texture with the clone stamp tool.


Step 12 - Surveying Our Land
Well, the dirt isn't the coarsest  in the world, but I still I wouldn't want to walk across it with my bare feet!   Overlaying the two textures we have created so far gives us the following scene:



Step 13: By now the tutorial is reaching it's end. You should already have a good idea how the Pattern Maker works by creating two new high-quality textures. But, since we've started making a road, let's finish it in great style.

Create a new document 256px*256px in size. Paste in the grass texture and, above it in a new layer, the dirt texture. Copy & Paste another dirt texture layer above and hide it. We're going to reproduce the transitions between dirt and grass, starting with the left hand side of the road.   So, without further hesitation, pick up the eraser tool, and choose a large-diameter spray-like brush. Set the Opacity between 90-100% and gently clean up the left side edges.

Step 14: Lower the brush size and set the Opacity to 30-40%. You should now attempt to smooth the transition between the two textures, giving us a final result like the image on the left.

Step 15: Now here comes the tricky part: How can you know the upper/lower borders will merge properly? You can, of course use brute-force, changing the images slightly every time before testing in your 3D Editor - but that's a very tedious solution to the issue. Instead, behold the miracle of Filters > Other > Offset! Just in case you've never heard of this filter before, it  allows you to offset an image on the X & Y axes. It's a very important filter, and makes our life much easier. As a limitation, though, it can only be used on one layer per time, meaning that you'll have to run it on both layers independently making sure the settings are identical. With this in mind, run the filter with a Horizontal value of 0, and a Vertical value of 150.  Make sure you have  "Wrap Around" selected, and click OK. Do this for both layers.


Step 16 - Its a Road!
With practice, you will not have a problem with jagged edges. If you do, just use Clone-Stamp and the Eraser to make them vanish. Then, using the Offset filter again with a vertical value of -150, move your scenery back to its original positions. Save your image, hide the dirt layer, and unhide the second hidden dirt layer we made in step 13.

Repeat steps 13 to 15, but with the right hand side of the image. You can, of course, just replicate the left-hand path edge, but this would add reality-killing symmetry, which is definitely discouraged.  And that's it - You're done! You should ideally play around with the brightness, contrast, and hue of your final image to reflect nature more accurately, but I'll leave that to you!


Epilogue: This process is used in many professional areas, and is a very valuable technique. The results are top-end and, if I used a bigger resolution for the grass, I'm very sure it would end up better than the grass textures I've seen in some TOP MMORPGs recently (not mentioning any names, of course ;).

One thing you must keep in mind is your gaming engine of choice. I've covered how to make the transitions between tiles, but this is a rather obsolete technique as many of the newer map-makers do this automatically for you. Nevertheless, its still a valuable skill to learn for many other graphical tasks. One example of a game that uses the tile system best is Ragnarok Online.  The grass is made up of hundreds of mini-tiles!   Whilst they may not blend together perfectly all the time the final result is still, in my opinion, visually impressive and extremely difficult to imitate.

Last but not least, I used 256px*256px textures for my examples above, but I highly recommend you to always work with 512*512, or, if possible, even 1024*1024.  Of course, if you are working on a game that uses small tiles, you will stick with 32*32, 64*64, etc. But since we're in the age of uber-expensive video cards, you really should train with the highest resolutions possible.  Well, that's it. I hope this tutorial was useful to you. Don't forget to train and develop your own methods - Pattern making isn't as simple as loading a plug-in after all!




All Content © BioRUST 2012 All Rights Reserved.