How to (not procedurally) Build a Tiling Cobblestone Texture
A friend of mine, Geoff Lester recently covered building tiling brick textures procedurally using Houdini and Substance Painter. I highly encourage you check out his blog! After reading through it, he'd thoroughly convinced me to build my textures non-procedurally in Blender and Substance Painter (well, there really isn't any avoiding of procedural when using painter, so I'm sort of doing this half procedurally). Guess I lose the Technical Director Buzz Word Bingo, Geoff!
The point of this tutorial isn't really to show of any fancy Tech Artist techniques for building stuff, but rather, to help out any programmers out there looking to learn how to make some art for their games.
Blender is best used with thorough hot-keying. So with that in mind, I've echoed all key presses on the top of the screen during the blender portion of the videos. In addition, after each blender video will be a list of steps, and the hot-keys used. All my hot-keys are Blender defaults, so you should be able to download the latest build, and get going! The videos are all broken up into relatively short sections, if you want to try follow along. I know the steps look quite long, but once you get a handle on the hot-keys, it's really only about 10 minutes work. Additionally, if you are somewhat comfortable in Blender, you can probably just skip the steps, and watch the vids!
If you'd rather just plow through the vids, I've added them to a Vimeo album here. :)
Lastly, I know at the beginning of this project I said I'd be using completely free software. Well, guess I lied. Substance Painter 2 is just too insanely good not to use. The texturing of any asset is now the easiest and fastest part of the pipeline. Also, for an Indie Dev, the asking price of $164.99 CA is completely reasonable.
Creating the Base Pattern
The cobblestones in this texture will be represented by the individual faces in this stage. The idea is to quickly create some separated faces in a radial pattern.
- Select all (A) or drag select (B then Drag) and delete everything in the scene (X).
- Bring up the command index (Space Bar), and search for Add Cylinder. This will create a cylinder at your 3D cursor, which should be at the origin of the scene. In the options on the side, set the sides to 16.
- Enter edit mode (Tab), and select (Right click) the bottom face of the cylinder. Delete it with X, and choose vertices.
- Select the top face, and then move it down to world zero (G enters move, Z then restricts the movement to the Z axis, holding control will make the movement snap to regular units. I do this a lot instead of manually entering values for precise movements. Left click confirms the movement, right click cancels).
- Select all faces (A), and then inset them (I). Repeat the action until you have as many stones as you want (Shift R repeats last action).
- Select all again. Use (I) to inset again. This time, go to the options on the side and change the face option to individual, and use select outer.
- Delete the selected faces (X, and choose face).
- Tab will exit edit mode.
Cropping the Pattern
Now that we have a nice pattern of potential stones, we need to make sure they can tile together. To do this I create a series of cylinders, join them, and use them to boolean out any overlapping areas that will tile.
- Press space and choose add cylinder; this time in the options on the side increase the radius by 0.01.
- Move the cylinder across one unit on the X axis (G then X, and hold control).
- Duplicate the cylinder and move it down 1 unit on the Y axis (Shift D then Y, and hold control to keep it snapping, left click confirms).
- Duplicate again, and move it across 1 unit on the X axis (in the opposite direction to the original).
- Repeat the last step. You should now have 4 cylinders in an L shaped pattern.
- Select them all (right click the first one, then hold shift, and rick click each of the others).
- Join them into one mesh (Control J).
- Select the original mesh (Right Click), and add a boolean modifier to it.
- Set it to union.
- Pick the joined cylinders from the empty drop down.
- Apply the modifier.
At this point we add several modifier to make the model 3D.
- Add solidify modifier to the mesh, and choose an appropriate thickness.
- Add the bevel modifier, and set the thickness as large as you can.
- You'll only be able to add a slight bevel. So add a displacement modifier to balloon it out, exaggerating the initial bevel.
Randomising Brick Placement
To help make the texture more natural, you can now select and shuffle around the various face. Normally I'd be all like “Eww, manual labour!”, however, sometimes you have to decide if it's really worth spending the 30 minutes to write a script to replace the 30 seconds of manual labour.
- Open the mesh into edit mode (Tab).
- Randomly rotate and move around a few bricks. R enters rotate, S scales, and G moves. All these commands can be constrained on the X, Y, and Z axis by pushing that key after. Also, if you move the view around, the commands will be relative to the view direction.
- At this point I apply all the modifiers, as it helps with performance later.
Refining the Model
At this point I add as many polygons as my computer can handle, and then add some noise to the model to help make it feel more organic!
- Add the subdivision surface modifier, and set the level as high as you can (keeping in mind you'll be duplicating this 8 more times). My computer goes OK with a level of 4.
- Set the modifier mode to simple, so as not to change the shape of the object. You know, unless you like the bubbly shape.
- Add a displacement modifier, and create a new texture.
- Choose a noise type that works well for your mesh. For this chiselled bricks I choose veronoi, and change the size a little.
- Once again I apply all modifiers.
Tiling and Exporting the Model
So that's it, the basic model is done. Now all we have to do is duplicate it several times so the pattern tiles at 0-1 on the X and Y.
- Duplicate the mesh 8 and move them around the individual (Once grabbed, or duplicated, press Shift Z; this will constrain them to moving along the X and Y. Hold down the control key so they snap, this will help you arrange them around the original into a 3 by 3 grid).
- Create a plane for the background to cover any holes (Use space to bring up the command list, and search for Add Plane).
- Enter edit mode on the plane (Tab), and grab each corner, moving them to mostly cover the grid (G, then Shift Z again to constrain on the X and Y. Hold Control to keep it snapping easily).
- Select all the meshes, and then export them to an FBX file. Make sure to choose selected in the export options.
Creating and Exporting the Low Poly
Now that you have a high poly, it's time to make the plane to bake the tiling texture onto.
- Create a plane that covers the tiling area of the texture (use the steps from the background plane for the high poly mesh, except the mesh should cover x=0, y=0 to x=1, y=1).
- Open edit mode (Tab), change to viewport to top down. Select the face and unwrap (U) the polygon using Project From View (Bounds).
- Exit edit mode.
- Select the mesh, and export it to a different FBX file.
Making the Substance Painter File
So now we have both the low and high polygon mesh, we can create our Substance Painter file and bake the textures painter needs to work.
- Choose "File New".
- Pick the low poly mesh using the select button.
- Click the bake textures button.
- Increase the front and back distance for baking.
- Turn off seams under the curvature tab.
- Bake the textures.
Creating the Material
This is where the fun begins. Painter makes it really easy to get fantastic results, so don't take this list of steps as a set of rules. I just added a couple of layers quickly to show how fast you can get something that looks great!
- Add 3 fill layers.
- Place a material that represents the grout in the top layer (I use gravel).
- In the middle layer choose a lighter rock material (I use a light concrete).
- In the bottom layer choose a darker rock material (I use a darker concrete).
- Add black masks to the top two layers.
- Browse through the smart masks, and add various combinations of masks.
- I use Dirt Soft 2, and Stain Scratches on the middle layer.
- On the top Layer I use Occlusion Strong, with a levels to increase the strength.
Exporting the Textures
(Base Color, Normal, Roughness)
Simply press Control-Shift-E, and hit the export button! You can customise the exporter to suite the engine you're using, but that's another tutorial. :) Here's the results of the tutorial, but remember, the whole point of this thing was to teach a man to fish!