Wc3C.net (http://www.wc3c.net/forums.php)
-   2D Art Tutorials (Skinning) (http://www.wc3c.net/forumdisplay.php?f=428)
-   -   Creating Seamless Textures - from tiled textures to complex UV's (http://www.wc3c.net/showthread.php?t=96451)

TDR 08-30-2007 01:54 PM

Creating Seamless Textures - from tiled textures to complex UV's
27 Attachment(s)
This tutorial is for both Photoshop and 3ds max. So to get started you must have them both. If not Photoshop, then an equivalent image editing/painting program, but 3ds max is indispensable. Also previous knowledge of these application is required, THIS IS NOT A TUTORIAL FOR BEGINNERS.

This tutorial will guide you through the process of making seamless textures. For those of you who do not know, a seam in a texture is this:
Zoom (requires log in)
It's where you see that nasty break in the texture when it doesn't tile perfectly or where bits of the texture don't blend in well. I'll show you in this tutorial how to get rid of those nasty things and make your textures seamless.
We'll start with the most basic situation where you can encounter seams: in tilable textures. Tilable textures are basically patterns that are repeated over and over again on a surface. You'll want, for example, a brick wall. So you take a photo of a brick wall, but when you tile it you see those nasty seams, like in the picture above. You'll have to work it a little bit to make it perfectly tilable.

After that, we'll take a look on a model with a complex unwrap. I bet you more than once found yourself in the situation where you have the arms separated from the body in the unwrap and you just couldn't fix that nasty seam on the shoulder. Or that nasty seam that stretches all the length of the arm or leg. Or you just wanted to make texture painting easier. I'll show you a method that fixes all those. The method is very similar to the projection master from Zbrush, but if you don't have Zbrush this method works just as fine. It's just a bit more tricky.

One thing to note though: I won't teach you how to actually paint or how to unwrap a model, there are already tutorials about this. I'll show you methods to make your textures seamless.

We'll start with the basics:

Making seamless repeatable textures (tiles)

Tools you'll need: Photoshop

Textures that tile over a surface are like square repeatable patterns, so any 2 opposite edges of the texture must blend in perfectly.
Let's talk about this on an example. You can have anything from a photo of a wall to some hand painted stuff. I'll work on some hand painted guts or something that I made:
Zoom (requires log in)
When you have complex things going on in a texture you want to tile, things may look daunting. But it's actually very, very simple.

Open your texture in Photoshop and from the Filter menu go to Other -> Offset...
Zoom (requires log in)
And this little dialog box will pop up:
Zoom (requires log in)
In Horizontal pixels right and Vertical pixels down type in half of the width/length of your texture. My texture is 256x256 px so I'll type in 128. What I get is this:
Zoom (requires log in)
It's kinda nasty. That's what you would get if you were to tile this texture as it is. So now you fix it. It's really easy: just paint over those seams. Here's the final result (place your cursor over the picture to see the original offseted one):
And now you got yourself a seamless texture. You don't need to offset it back, it's exactly the same thing. Here's the tiled result:
Zoom (requires log in)
One thing to have in mind when making tiled textures though is to have as few distinctive marks in the texture as possible and to make as much variation as possible so the repetition doesn't seem that obvious, like in this case.

If you want to make a texture from a photo, then use the clone stamp tool to fix the seams.

This method may be applied in other applications that support this offset thing, but I don't know about others so that's why I exemplified in Photoshop.

Now on to the next level,

Making seamless textures on UVW unwrapped models

ATTENTION: this part of the tutorial is dedicated to intermediate/advanced users. If you are a beginner in 3ds max, then first learn to use from the tons of tutorials on the net and from max's tutorials.

Tools you'll need: 3ds max, Photoshop (or any other painting application of your choice really, it doesn't matter in this case; 3ds max is the main tool here)

Now here's where things get a bit tricky. When you unwrap a model, in order to get a perfect UV layout you can't keep all parts attached so you'll most oftenly find yourself with, say, the arms and legs separated from the chest. Also the arm/leg is basically a cylinder so it's unwrap will have a break somewhere along it's length that will result in a seam. These kind of seams can be a pain in the ass to fix if you don't know the right method. But I'll show you a method that will save you time and effort and that's fairly easy to do.

First things first, fire up 3ds max (I'll use version 9, but this can be done in any versions as far as I know...I hope so...though I'm not that sure if 5 can do it, but I think so...right now my version 5 is a little screwed up so I can't check at the moment) and open your model. Again, I won't show you how to unwrapp it, check Whitehorn's tutorial for that. This model that I'll illustrate this method on already has it's UV's layed down:
Zoom (requires log in)
Zoom (requires log in)
One thing to note about the UV's: try to keep your uv's as consistent as possible. By that I mean that at least the parts that need to be connected must be the same scale. To do that, apply a checker pattern texture on your model and try to make the squares approximately the same size all over your mesh:
Zoom (requires log in)
This is necessary so you have the same ammount of resolution all over your texture. You wouldn't want the leg to be more pixelated than the body.

Ok, now let's start working on this thing. I won't make a serious texture for this, in order to illustrate the method let's make him a tattoo or something. So I go in photoshop and draw something on this dude:
Zoom (requires log in)
Zoom (requires log in)
Hmm...ok, but I want some thorns or something extending down on it's leg. But the leg is detached from the body and at a different angle than it actually is. So how do I do that? With a sort of projection painting. This is where the tricky but cool part starts.

Make sure that in the moifier stack you have a Unwrap UVW modifier applied to your mesh that holds the current UV's. Also make sure the map channel is set to 1:
Zoom (requires log in)
Now set your view so that you have a clear view on the part you want to paint on. After that, apply another Unwrap UVW modifier on top of the one you already have. Assign this modifier a map channel of 2 (or any other number you fancy as long as it's not 1, so it won't override with the original unwrap); a dialog box will appear saying some mumbo jumbo, just accept:
Zoom (requires log in)
Ok, now remember I said to set your view so you have a clear view on the part you want to fix. This is also extremely important. I already did so, as seen in the previous screenshot. So now, while in the top Unwrap UVW modifier, select all the faces of your mesh (DON'T change your view; just press ctrl+A in while in face selection mode) and from the Map Parameters rollout chose Planar and then click Align To View. That's why the view was so important.
Zoom (requires log in)
When you view the uv's, this is what you get:
Zoom (requires log in)
It's basically like a wireframe view of your model seen from that angle. But it's distorted so it fits that bloody square. No problem, just stretch it out so it resembles the actual model as close as possible and then scale it down so it's within the square:
Zoom (requires log in)
This is basically ready to paint on, but it ain't of much use if you can't see where the tatto is now, is it. So let's do that now.

What we basically want to do is to take the texture from the map channel 1 (the original unwrap) and view it on this new unwrap (channel 2). We do that with the neat Render To Texture tool.
So first of all select your mesh. Then open the Render To Texture dialog by either going to the Rendering menu -> Render To Texture or by pressing 0 on your keyboard. Then this nice little dialog box pops up:
Zoom (requires log in)
First of all chose a folder where you want the texture to be saved. Then make sure that the map channel is set to 2, so it takes the information from channel 1 and projects it into the current channel, 2.
Next scroll down a little until you reach the Output rollout. There click on Add and from the little pop up that appears select DiffuseMap and confirm by clicking Add Elements:
Zoom (requires log in)
Change the name and type of file to whatever you like and the resolution preferably to something high, like 1024x1024. Then hit Render, wait a little, and then it's ready. Here's what I got:
Zoom (requires log in)
It's basically the same thing you had in the viewport, but now you can paint over it and fix things. So I now take this into Photoshop and start adding some thorns & stuff:
Zoom (requires log in)
Much better. Now all we have to do is to reverse the render to texture process. We have to render this texture information back on the first UV layout.

So, first you have to assign this new texture to your model. Go to your material, change the texture to this one and also change the map channel to 2:
Zoom (requires log in)
Now open the Render To Texture dialog again and change the map channel to 1 and change the resolution to the original one of the texture (mine was 512x512). Also don't forget to assign a different name for the texture. Now hit render. This is what I got:
Zoom (requires log in)
Notice that it projected the texture all the way through the entire model, so you have that texture stretched over the underside and on the back side of the leg too. But just go ahead and erase what you don't need and you're done:
Zoom (requires log in)
The hoofs aren't unwrapped, that's why they're such a mess :P.
You can now go ahead and delete the unwrap modifier you used to project the texture, if you don't need it anymore. And don't forget to change the map channel to 1 again in the material.
You can repeat this technique as many times as you need on a model. For example now I want to add an individual that licks that heart tattoo. So I'll do it directly on the projection unwrap instead of starting first on the original unwrap:
Zoom (requires log in)

And here's the final result:
Zoom (requires log in)
Zoom (requires log in)

NOTE: while making this tutorial, I sometimes got strange results when I rendered to texture. The map was screwed up, looked like a broken mirror. What worked for me in this case was to switch between renderers (default scanline/mental ray). But I didn't experience these distortions so far.

I hope this helped you and if you have any questions, post here. Cheers.

TDR 09-03-2007 09:00 AM

err...yeah. Some feedback would be very appreciated. Mike? Erwt? Olof? Anyone?

BlinkBoy 09-03-2007 02:54 PM

quite good :emote_grin: , yet you should organize it a bit better. First add the Tools you'll need at the start of the tutorial, a pointed out by a subtitle. You should also add a brief introduction contaning: the purpose of the tutorial, and a fast summarize of what you are going to do.

I found the tutorial extremely interesting and excelent, it's good to see tutorials this good. + Rep :emote_thumbup: keep up the good work!

TDR 09-03-2007 03:46 PM

alright, I'll make those changes.

TDR 09-09-2007 09:22 AM

uh...yeah...no more feedback? This is a very good technique you know. If I didn't explain it detailed enough at least let me know, maybe I'll make a video.

EDIT: I figured out how to apply the last technique in max 5. It's basically the same thing, but a different method to do it. I'll update this soon.

PitzerMike 09-12-2007 05:41 PM

Cool, approved anyway.

jigrael 09-27-2007 05:06 AM

I didnt knew you could do that in photoshop, very useful. But if you can get a prjection painting program...

Dwarf Zealot 02-28-2008 07:13 PM

how do you make a good unwrap? Try as i might mine always suck

edit: TDR please can you post how to do this in 3dsmax 5? i would really appreciate it

TDR 03-04-2008 03:52 PM

ya I'll do it soon.
No matter how hard you try, max 5 just sucks terribly at unwrapping. You should better get max 9, which is bliss. And just asking how to make a good unwrap is pretty useless, because it's a vast subject and you should search for yourself (you can find ANYTHING on the internet man!).

Dwarf Zealot 03-04-2008 05:42 PM

yeah i am seriously considering getting max 9, with starcraft 2 coming out and all. Thanks for the tips.

MantisScreamer 09-07-2008 12:44 AM

Thats pretty sick dude, I've always wanted to know how to make seamless textures and this is the perfect way, thanks.

Dionesiist 09-11-2008 09:25 AM

No update for Max 5? D:

TDR 09-11-2008 12:49 PM

OMG right! And also I'll show another method to do this.

Dwarf Zealot 11-12-2008 08:29 PM

DO IT NOW!!!!!!!!!!!!!!!!!!1..... pl0x?

All times are GMT. The time now is 08:54 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services