Join Rob Garrott for an in-depth discussion in this video 045 Tiling images in Photoshop for 3D textures, part of Design in Motion.
Hi! Rob Garrott here and welcome to Design in Motion; the weekly series where we explore important fundamentals in the world of motion graphics. In CINEMA 4D, when you create a material and apply it to an object, the application has to figure out how to apply a 2D image and wrap it around a three-dimensional object. Well, what happens when that fit isn't exact? Well, CINEMA 4D has to repeat the texture or tile it across that surface. Now this can create visible seams in your object. However, if you're careful about how you create your materials in Photoshop and careful about how you apply them in CINEMA 4D, you can get great looking results with no visible seams.
Let's take a look. I've created a very simple animation here to illustrate this concept and I'll hit play inside of QuickTime Player. And so we've got a very simple animation of the word asphalt, and it's made out of asphalt, and it's sitting on top of asphalt. If we pull back and scrub in just a little bit, we can see that we've got a great looking asphalt texture here, and it's applied to both the type and the ground plane. Now when I back out a little bit, you can see that it goes off to infinity, but I've got my light set, so that I am hiding the background here, and that's very important.
We'll talk more about that in just a second. But, the reason this works is because I've applied a texture that I created in Photoshop onto this ground plane and onto the type as well. The reason it looks so nice and I don't see any seams is because I've done a great job of tiling that texture. Let's move over to CINEMA 4D to take a look at what that means. So here is the asphalt-START file, and this is just the word asphalt, exact same camera move that we had before. And what I want to do is to create a new material that we are going to use to apply to the ground plane.
So I will double-click in the Material Manager and this material I'll call Asphalt. Now in this Asphalt texture, in the color channel, I am going to load in a PSD file, and let's click on the Load Texture icon and navigate to asphalt-START. And this is just a picture of asphalt that I took in my driveway, and let's click open and that loads into the color channel. Now let's apply it to the floor. We apply it to the floor object, and you will see that it now is repeating off into infinity on the floor object, and you can see that was a very distinct pattern of repetition, and that's because the tile is not big enough to cover the entire floor.
So CINEMA 4D has to repeat it over and over again. And because the image isn't seamless, each side of the image doesn't match. Then when it repeats, you see a noticeable seam. So what we are going to do is correct that in Photoshop. Inside of Photoshop, we are going to open up that image. So I'll hit Command+O or Ctrl+O and navigate to the exercise files, to the tex folder and grab asphalt-START. Now this is an image I shot in my driveway. Let's hit Command+0 or Ctrl+0 to maximize the image in the interface. What we want to do is to figure out where to clone to get rid of the tile marks and to make both sides repeat.
There is a great filter for that called Offset. Now before we use the Offset filter, we need to know how big our image is. Let's go to the Image menu > Image Size and take a look at it. It's 1900x2500. Those numbers are going to be very important later. So let's hit Cancel there. And under the Filter menu, under Other, is the Offset filter, and when I let go of the Offset filter, I get this interface. Now your Offset filter is going to probably come in with 0x0, and it already--and mine came up because I practiced this ahead of time.
If you haven't quit Photoshop, it remembers the last values of the filters that you had in there. What this filter does is it allows you to shift the pixels left or right or up and down based on a specific numerical value or on the slider. You can see if I drag it to the right, and so when I move the slider, you can see that I've now pushed the image to the right, and the pixels that were on that side get pushed all the way over and appear over here. So now if I put my numeric values in here, I want to get exactly half of my image size. So it was horizontal, 1900. So half of that would be 950, and a vertical of 2500; so half of that would be 1250.
And you can see I get now an exact centering of those seams, and let's hit OK there and commit it. Now you can see exactly why we were seeing a repeating pattern. The sides of these images, which are now meeting in the center, don't match up and we can see a distinct seam. So what we are going to do is clone out these seams and what we'll be left with is an image that tiles across each of its sides. To do this, we are going to use the Cloning tool and I've got the Cloning tool already selected, but that's it right there, icon looks like a rubberstamp.
When I select that, the brush that I want to use is going to be I think probably this one right here. And when I click that, it gives me the Size of the brush and there's no Hardness in the case of this brush. So I am just going to click out here, and get rid of that. Now when I click out there, it's going to give me this error message, because I haven't defined a cloning area. So I will hit OK there. Now I before I do anything else, I want to make my brush larger. So let's hit the right-bracket a few times, and get that up to about 200 or so; maybe 250.
Now what I want to do is to pick a cloning source, and I am holding down the Option key and make sure that your Opacity and Flow are at 100%, and click and drag. So what we want to do is to clone out those seams. One of the keys to this technique is using a brush that kind of looks like the texture that you're cloning. And if I were using a soft edged brush, I would be seeing these noticeable soft edges every place I cloned. And so by using a rough edged brush like this one, it really blends in well with the asphalt.
So let's go and start to paint out all these seams. What I want to avoid doing is this, I don't want to paint off the edge. I want to keep the edges as pristine as possible without actually going over them. So I want to be very careful. I also want to try and even out some of the color patterns. I am not trying to erase the color changes completely. I am just trying to smooth them out so I don't see quite so much in the way of color shift. You can see I am never going all the way over the edge, and I am always kind of being conscious of those seams, and trying to minimize, and I also want to get rid of any large marks like that, because that mark will show up every time the pattern repeats.
That big splotch there I think is not good. There we go! I get rid of that. Just kind of working your way around, and there is definitely a fine art to this, and it's something you may have to practice a bit as you're working. I think that's going to be pretty good. I just want to get rid of any really large noticeable--like that line right there I think is going to cause us problems when it repeats and that brown spot as well. There is a little bit of a pattern here, but I think you guys get the idea. You can go in and tweak on this quite a bit, but the main thing is we can't really see those seams anymore, and that's pretty much it.
Now what I am going to do is save this. So I will go File > Save As, and now in the tex folder, I am going to call this asphalt color, and this is going to go into the Color channel of our asphalt material. Now what I want to do is to make an asphalt bump map, because we need a bump pattern that we are going to use. Now I could just use the color, but I want to give the bump a little more intensity, and so I need to use some levels on this. So I am going to go to the Image menu and to Adjustments and to Levels, and in the Levels filter, I'm going to crunch it up.
So let's bring it over, crunch those blacks up, push the Brightness and bring the highlight over there, and let's crunch it down just a bit. There we go! We're trying to really increase the contrast without totally crunching it up. We don't want to actually decrease the color levels, we just want to increase the contrast a little bit. So now we can hit OK. Then what I want to do is to remove all the color and make it grayscale. So let's go to Image > Mode > Grayscale, and yes, we want to discard the color. And now we've got a great looking bump map that matches exactly to our color map.
So now let's save this, and I will just go File > Save As, and we will call this asphalt bump. The Bump channel is now ready. So let's move back to CINEMA 4D, and here in CINEMA 4D let's reload our image. So go back to the asphalt material and in the color channel, let's replace this asphalt-START with the asphalt color. So I'll click on the Load Image, and I'll navigate to the exercise files and go to asphalt color, and hit Open. What happens is when this gets done rendering, you're going to see all of those seams are going to go away.
Now you notice we still see a repeating pattern? Remember, at a certain distance everything repeats. So what we need to do now is to blow that up, but we've got rid of a lot of the seams already. Now we need to get rid of the noticeable pattern. The way we do that is by enlarging the image. So the way we do that is by going into the texture tag and adjusting the number of tiles. Now higher values mean smaller tiles, lower values mean larger tiles. So let's go and try 0.25 and I'll hit Tab and 0.25.
What that's going to do is give me a much larger tile pattern. There we go! Yeah, looking good! You can see we already removed a lot of the repetition out of there. Let's go to 0.15x0.15. There we go! Yeah, I think that's looking really good. Now off in the distance there, you can see that we are actually repeating in the distance, and like I said, at a certain distance, there is always a repeat.
So what we want to try and do is minimize the repeats near the camera and then hide the ones that are in the background. The way we are going to hide them is by adjusting the lights. Right now, our key light here extends off to infinity. It has a definite focal length, but it doesn't have any true falloff like lights in the real world. So on the key light, I will go to the Details tab and change the Falloff from None to Linear. And when I let go of that, the light intensity will diminish as it reaches out from the original light source, just like a light in the real world would.
So what's happened now is that I've limited the distance the light is traveling and I can no longer see those repeats in the background. And a lot of times in 3D, that really is half the battle, it's kind of hiding mistakes like that. You don't have to obsess about them if you can hide them. So now what we can do is finish off our material. In the Asphalt Material, we want to add in a bump channel. So let's click on Bump, and in the bump map, we are going to load in our bump texture. So we click the Load Image button, navigate to the exercise files to the tex folder, asphalt bump, and hit Open. You're going to see a noticeable improvement in our texture here once it finishes redrawing the screen.
There we go! We've got a really nice crispy looking texture and let's crank up the Intensity on that bump, get the Strength up into like 70 region. There we go! And it's going to finish redrawing the scene, when you see that progress bar at the bottom finished, then you will know it's done. The last thing I want to do for the asphalt color is to go into the basic properties and activate something called Specular Color. You notice that I have a specular highlight on my asphalt ball here, and it feels very smooth. It doesn't really match the rough texture of the asphalt, and that's what the Specular Color channel is for.
It helps you determine where and how the specular color shows up on the object. So by loading in the color image, I can use that information to distribute the specular highlight across the asphalt in a very natural way. So let's click on the Load Image button and navigate to asphalt color, and now you'll see that, that asphalt specular highlight has been broken up significantly. When it finishes rendering, it won't necessarily look different from this angle, but it's a very important step to do. Now we are ready to texture the text.
So what I'm going to do is duplicate this texture; hold down the Ctrl key, and drag to the right here, and we'll call this one Text Sides, and let's take this Text Sides, and apply it to the Extrude NURB. When I do that, it doesn't really look like much changed, and that's because the default texture application for an Extrude NURB really isn't very useful. It's something called UVW Mapping. So what we want to do is change that to cubic mapping. So in the Texture tag, on the Extrude NURB, let's change the Projection to Cubic, and then you're going to see our asphalt material show up on the face of the type.
Now it's very, very small. Let's zoom in on the type just a bit. Let's back up in time to where we're closer. There we go! What we want to do is to make the asphalt texture on the type as large as the asphalt texture on the ground. So we need to adjust the tiling again. So on the tiles, on the Extrude NURBS, we select the Texture Tag, and go to the Tag Properties and adjust the tiles downward. Remember, lower numbers mean bigger tiles. So let's try again, 0.25 as the starting point in both the U and V, and then see if that gives us what we need.
So what we want to look at is the spot where the type joins the ground. So I think that's going to do it; Tiles U .25 and Tiles V .25. That gives us just the look we need. Now one last thing we want to do is to have these sides a little bit darker than the face. So let's duplicate this material and then on the text side, change that name to Text Face. And then rather than refigure out all of our material settings, we can just duplicate this texture.
Hold down the Ctrl key and drag a copy of it right to the right, and then to replace the material here on the tag, we take the Text Face and apply it right to there. Now it doesn't look like anything has changed, and that's because both of these textures are the same. Very important step I want to do though, is in the Selection field, I want to tell this to only show up on the face of the object. So I go C1 and I hit Return, and that's going to make the material only show up on the face of the Extrude NURB. Now what I can do is in the Text Sides, we want to introduce something called Diffusion to darken that texture up.
So I go to the Basic Properties, and I add in Diffusion. And in the Diffusion channel, and the Diffusion channel is often referred to as the dirt channel by a lot of 3D artists. That's because it's used to add dirt and the look of dirtiness to objects, and it helps to darken the texture in random ways. So what I want to do though is load in a texture. So I'll click on the Load Image button, and in the tex folder is this grunge-01. Now this texture already tiles, I fixed it in Photoshop ahead of time using the exact same techniques.
So let's open, and what happens is now we've got this pattern, you're going to see the edges of the type get much darker with this pattern, and that's going to help our type stand out quite a bit and you can see it, the diffusion pattern here, it's a little bit heavy. So I will lighten that up by adjusting the Mix Strength maybe about 75%. There we go! So now when we back out, we see our great looking asphalt. The key to this technique is being extremely careful about how you clone your image in Photoshop.
By combining the Offset filter with solid cloning skills, you can tile just about anything in CINEMA 4D. That's it for this edition of Design in Motion, keep it moving, and I will see you next time!
- Communicating emotion using color correction
- Using expressions to control animation
- Rendering type in a seamless environment
- Doing more with less in the After Effects render queue
- Creating bouncing animated type using dynamics
- Creating realism with Global illumination
- Working with Xrefs to simplify the workflow