Difference between revisions of "HowTo:FullUnwrapBlender"

From VsWiki
Jump to: navigation, search
("Starting Big" in Potato Mode)
m (Added categories)
 
(37 intermediate revisions by one other user not shown)
Line 1: Line 1:
=== Full ship unwrap ===
+
=== UV-unwrapping a '''"BIG"''' (complex) ship, using Blender. ===
  
Okay, so you've read the other tutorials but still get frozen in front of the screen when it comes to unwrapping...
 
Yes, it takes a lot of planning and preparation, and I'm still waiting for a half-decent automatic unwrap script.
 
Whatever time automatic unwrappers save you in unwrapping, they take back 5-fold when it comes to texturing.
 
Anyways, if you're like me, I hate oversimplified tutorials, like how to unwrap a cube. It tells me nothing about
 
the actual work of unwrapping a whole ship. And too small a ship to unwrap would be similar to just a cube. You want
 
to know how to unwrap a big, complex ship, right? You're in the right place now...
 
 
We're going to unwrap this baby:
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter14.jpg
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter15.jpg
 
  
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter16.jpg
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter16.jpg
  
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter17.jpg
 
 
By the way, if you haven't been introduced, this is the Cutter Class, a small capital ship --a corvette-- that I came up with for WCU's Wing Commander Zero project. We had a need for a corvette, but couldn't find any WC1 corvette other than the Venture Class, which is a lightweight, fast corvette for reconoissance. We needed a corvette that would make for a good transport and be able to serve as carrier escort --i.e.: be able to take some heat off the carrier and survive, rather than survive by running away.
 
 
Ready?
 
 
=== Clean up the mesh ===
 
 
First of all you need to make sure that you are 100.00% happy with the mesh. Not 99.99%. Why? If something shades funny, you won't be able to "fix it" with the texture, --other than by painting it matte black, that is; but you probably don't want to do that. You need to find your errors and fix them all. Typical mesh errors are split polygons that you didn't mean to split, non-split polygons that you did mean to split (read the tutorial on smooth groups, if you don't know what I'm talking about), missing polygons, inner polygons and edges shared by 3 or more polygons, free floating edges with no polygons... You need to clean all that crap first. One very useful trick is, from the Edit mode Select menu: "Non-Manifold". It's hard to explain what it does, so try it and get used to it. All mesh edges and splits will be selected, so you can make sure all your sharp edges are indeed selected. And if you find any edges selected that you didn't expect selected, they probably have coplanar or inner polys. It will also help you see missing polys. Another thing you should do is unclick the [Double Sided] button, to make sure you catch inverted normals.
 
 
If you work like I do, you probably have one or two dozen objects spread through half a dozen layers. For unwrapping we'll have to put it all back together in one piece. Well, two pieces really:
 
 
# The big parts
 
# The tiny parts
 
 
How big? How tiny?
 
 
The tiny parts are those parts so tiny we don't even care to texture them. In this case, all the hand-rails and ladders. What? You can't see them? Well, you shouldn't be able to see them. Let me get a close-up shot. Hold on...
 
 
Here. Notice the ladder, bottom left, and the scaffolds at the top?
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter18.jpg
 
 
There's scaffolds at the bottom also. I just added a couple of yellow lights to make them more visible.
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter19.jpg
 
 
Not saying you should have ladders and scaffolds; I use them as a way to give players a way to judge the size of a ship. Windows help also.
 
 
In any case, I was saying I don't care to "texture" the hand rails and posts. They are too thin for even one pixel. Well, maybe not too thin for one pixel, and perhaps them being illuminated by yellow spotlights might look good... Okay, forget it; we'll unwrap everything. Except the subunits, that is: The gun turrets, for example, will be sub-units, because they have to be able to turn. So they'll have their own texture. But we still keep their geometry, because we need their shapes to cast ambient shadowing during our bakings. So, we'll leave them in, but put them into a separate object that we won't UV-unwrap. Anything else you don't want to unwrap, put it into the separate object.
 
 
So, other than such exceptions, we want to have the whole ship be a single object. But now, chances are you may have scaled or rotated some of your objects. Chances are some are mirrored in the Y axis; --not just the X axis. Some may have a sub-surf modifier. Some may be curves (like pipes, for instance) rather than meshes. And some objects may be things you put there and meant to clean up later but forgot.
 
 
So, first you need to go object by object ... Best way to do this is by clicking on one object at a time in the outliner window; that way you don't miss any...
 
 
http://deeplayer.com/wiki/tut/FullUV/blender_shot_1sm.jpg
 
[http://deeplayer.com/wiki/tut/FullUV/blender_shot_1.jpg (Full Size)]
 
 
...and for each of them you apply any attributes other than X-mirroring, click on Center Cursor (assuming your cursor is at the origin; otherwise send it there with Shift-C), and then Ctrl-A to apply any scalings and rotations you may have done in Object mode. Otherwise you could have your normals all messed up (scaling and rotating objects in Object mode doesn't recalculate the normals until you apply it to the mesh). Then Shift-Right-click on the main object and Ctrl-J to join them. Once you're done, you'll have a single object.
 
 
=== Materialize it ===
 
 
Our next step will be to assign materials --i.e.: color our ship. Why color it in Blender when we're going to texture it? Because during texturing it is almost impossible to know what a color in the texture will look like in-game. Suppose you're trying to make a coil look like it's made of copper. How much red, green and blue do you need in the diffuse texture? How much of them in the specular? Unless you have access to a material's optical characteristics database that I've been googling for on and off for months without success, your only way to get things right is by eye. But to experiment with each material in the texture and try it in-game is insanity. It takes forever. Blender's renderer produces results that are pretty close to what you will see in-game, so the right time to get the materials right, is right now. And when we're done unwrapping, first thing we will do is bake a diffuse texture with the material colors. That baking will serve as a base and background for our texturing work.
 
 
'''Plus''', grouping our UV islands by similar colors will allow us to use our texture area more efficiently. Don't believe me? We'll get to this point shortly, but for a quick nutshell: A problem common with mip-maps and trilinear/anisotropic filtering in hardware is that there tend to be "leaks" of color between adjacent UV islands. One common way to try and avoid such leaks is to put extra pixels of the same color around islands, which forces one to have "wasted space" around islands. But if two islands are the same color or pretty close in color, such leaks will be less obvious, allowing us to put less, or no-, "padding" between them. So it is more efficient to group islands of a similar color together. By defining our materials in advance, we can, during the unwrapping, select facets *by material*, and unwrap those as a group, pack them all together, and later fit them in an area of the texture as a block.
 
 
As with the mesh, take your time and make sure you are 100.0000% happy with the materials now. An extra hour now is like 20 hours saved later.
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter21.jpg
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter22.jpg
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter23.jpg
 
 
Yeah, don't blame me about the green paint. If you know about Wing Commander, you know all Confed ships are green. And this is a much more modest shade of green than in the original games; believe me...
 
 
I'm using more materials than you probably think you are seeing:
 
 
*The main hull, I call its material "titanium" and it's [0.3,0.3,0.3] diffuse, [0.6,0.6,0.6] specular, hardness of 40.
 
*The turret and pipes: "aluminium", [0.4,0.4,0.4] diffuse, [0.5,0.5,0.5] specular, hardness of 20.
 
*The engines and dock: "stainless", [0.1,0.1,0.1] diffuse, [0.8,0.8,0.8] specular, hardness of 50.
 
 
IMPORTANT NOTE:
 
'''Beware of the evil "default material" in Blender.''' The default material is evil because it is totally unrealistic: It is way too bright; --white in specular, and almost white in diffuse. No such material exists in the real world, nor could it ever exist... The sum of specular and diffuse, for any component (red, green or blue) can never add to more than 1.0, or else the material would be reflecting back more light than it receives. Rarely the sum of the two is so high even. The sum of specular and diffuse brightness are called a material's "albedo", and most material's albedos are around 0.1 to 0.5. White chalk and a mirror would have albedos close to 1 (the former all in diffuse; the latter all in specular). But a material cannot be as white as chalk in diffuse AND reflect in specular like a mirror. NO such animal. And if you use the default material, you'll end up setting your lights really dim; which means that you'll end up with absurdly bright materials if you fine-tune them while rendering with such dim lights. So, before you even set up lights for rendering your model in progress for the first time, define a material like my "titanium" above, assign it globally, and delete the default material off your face for good.
 
/IMPORTANT NOTE
 
 
I also have a "dull grey" that I use for the boardwalks, and for the floors in the dockings. This dull grey is dull in the sense that it has no specularity --i.e.: is black in specular. One always needs one such material for surfaces that would, or rather 'should', reflect other parts of the ship. Well, all parts of the ship pretty much would reflect other parts of the ship, from the right angle; but what I mean is parts of the ship that should reflect other parts of the ship from "a lot of angles". You want to dull down specularity there because the trick that makes specularity happen, so called "environment mapping", will NOT reflect other parts of the ship. So rather than have an inconsistency or artifact, I prefer to trick it out of my face by simply having non-specular or low-specularity materials in key places. One such keyplace here is the floors of the launch/land bays. Specularity there would be disastrous because one would expect the lights inside the bays to show again as spots of light reflected off the floor, as if the floor was transparent, and the reflected light was under it. That's not going to happen unless we define the floor as a "mirror", which is a whole different kettle of fish. So, for a simple solution, we make the floor completely matte, like a piece of non-glossy cardboard. Come to think of it, I should make my walls and ceiling perfectly matte there too. I'll do that and post a new render.
 
 
You'll be glad to know that I'm following my own advice: As rushed as I am to get done with this damned tutorial and this ship, I'm still editing the mesh and fixing details. Some of the pics above are obsolete already... For example, I found that the ladder was too big by a factor of two. So I put a thinner ladder, and added a short plank-walk to the engine at the top of the ladder, to justify it as some kind of EVA maintenance access to the engine. I also found the interiors of the bays too poor in greebles, details, and size references; so I added ceiling lights and human-sized doors in the side rooms. Okay, give me a few minutes and I'll post a render...
 
 
Here we go:
 
 
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter25.jpg
 
 
Just in case you wonder, the "YellowLight" material is not emissive there; just 'Shadeless'. I never quite figured out emissive materials in rendering; sometimes they they seem to work, sometimes they don't; but even when they do they don't seem to cast shadows, so I use plain lights and spotlights; so the light fixtures are fakes, really...
 
 
http://deeplayer.com/wiki/tut/FullUV/blender_shot_2.jpg
 
 
Alright, I won't add any more greebles in the bays. Tell you why: My idea is for the bays to eventually be sub-units. The bays need to be functional: when you land, they should arrest your ship's motion, and suck it into an air-lock, then move it inside to a pressurize parking spot. I'll work on that eventually, and when I do, I'll fully greeble the interiors.
 
 
=== Think Hard First ===
 
 
Here's a list of constraints and requirements to get a "good unwrap" going:
 
 
The goals are:
 
 
# To have the least amount of stretching and deformations
 
# To have consistent scaling of the texture across the whole ship
 
# To minimize the number of seams and islands
 
# To have the arrangement of the islands so that locating a part of the ship in the textrure is intuitive, rather than requiring a throrough search.
 
# To have front and back view unwraps all together in one area of the texture, and all side views in another. The two areas of the texture should be well separated, hopefully across a single, horizontal line.
 
# To have all "side views" (including top and bottom) as a series of rotations, sort of like a cylindrical unwrap unrolling vertically.
 
# To align the front-to-back direction (z axis) horizontally on the texture (u-axis).
 
# To orient the front of the ship (positive z-axis) towards the left on the texture. This is so that, to produce dirt trails and scratches that should have front to back fading, we can do it in Gimp using horizontal motion blurs globally, rather than have to do laborious, region by region blurs, depending on the orientation of each island. Also, my texturizer software, when it's done, will assume that the front of the ship faces to the left on the texture, and produce dirt smears and scrathches by smudging dirt spots and impacts towards the right.
 
# To avoid "flipping" islands or polygons. A flipped island on the texture results in the polarity of the bumps on the normal map being reversed.
 
# To avoid overlapping or re-using islands (unless using dual UV-layouts) because radiosity baking and PRT bakings cannot work with overlaps.
 
# To avoid Islands touching, or even coming too close to each other; --except along an edge that they share on the model itself; --in which case they could (or rather should) be "stitched" together.
 
# To try to group islands by color or material, so that color "leakage" between islands due to gpu anisotropic filtering is of a similar color, and therefore less noticeable.
 
# To try to keep islands housed in rectangular areas, power-of-two pixels sized; and to ensure these areas have their starting x and y coords at an integer multiple of their x or y size respectively. I.e.: If a long strip island has a size of 64 pixels in x and 16 pixels in y, good placements for the rectangle in x, in the texture, ar at x=0, x = 64, x=128, x=192, etceteras. That is, 0, 1, 2, 3, etceteras, times its x-size, 64. Good placemtents in y are 0, 16, 32, 48 .... same idea. Why? To avoid, or rather minimize, mipmap color leakage between islands. Mipmaps are recursive reductions of a texture by powers of two, using block averaging (4 pixels are averaged into 1). So, if two islands are separated by a row of pixels at x or y = 77, mipmap leakage will start much earlier than if the boundary between them is at x/y = 64, for example.
 
# Finally, to, --as much as possible--,  make efficient use of the texture, while upholding the previous standards.
 
 
Easier said than done, let me say it :) The day someone comes up with an automatic UV-unwrapper that takes all the above into consideration, that will be the day...
 
 
But anyhow, read and re-read the above list until you wake up in the morning thinking about it, and next we'll start placing seams, while thinking about all that...
 
  
=== Placing Seams ===
+
http://deeplayer.com/dan_w/WCUships/Cutter/Cutter50.jpg
  
  
...
+
Please be sure to read each chapter thoroughly and in order, for your own good... UV-unwrapping is a science, not an art or a sport. I've tried hard not to skip any steps in this tutorial; but you'll have to do your part, by not missing any part of the tutorial.
  
(Last step: Align vertices near x=0 to x=0, apply X-axis mirroring, and place the central seam.)
 
  
=== Optimizing ship orientation for UV unwrapping ===
+
* [[HowTo:FullUnwrap1Intro|Introduction]] (done)
 +
* [[HowTo:FullUnwrap2Clean|Clean up the mesh]] (done)
 +
* [[HowTo:FullUnwrap3Materials|Materialize it]] (done)
 +
* [[HowTo:FullUnwrap4Clean2|More cleaning up]] (done)
 +
* [[HowTo:FullUnwrap5Think|Think Hard First]] (done)
 +
* [[HowTo:FullUnwrap6Seams|Placing Seams (Part 1)]] (done)
 +
* [[HowTo:FullUnwrap6Seams2|Placing Seams (Part 2)]] (done)
 +
* [[HowTo:FullUnwrap7Orient|Reorienting the ship for unwrap]] (done)
 +
* [[HowTo:FullUnwrapStarkOp|A Stark Choice...]] (done)
 +
* [[HowTo:FullUnwrap8Potato|Entering Potato Mode]] '''(W.I.P.)'''
  
=== "Starting Big" in Potato Mode ===
+
(2 be continued; more chapters even; this is a W.I.P. --Work in Progress)
  
Do the biggest parts first.
+
Announcement: Next tutorial will be about texturing, and it will rely on many of the unwrapping tricks we used in this tutorial, such as having the front of the ship facing left on the texture, etceteras...
  
  
(2 be continued; this is a WIP --Work in Progress)
+
[[Category:HowTos|Unwrap in Blender - Advanced 0]]
 +
[[Category:Modeling|Unwrap in Blender - Advanced 0]]
 +
[[Category:Blender|Unwrap in Blender - Advanced 0]]

Latest revision as of 18:05, 9 September 2008

UV-unwrapping a "BIG" (complex) ship, using Blender.

Cutter16.jpg


Cutter50.jpg


Please be sure to read each chapter thoroughly and in order, for your own good... UV-unwrapping is a science, not an art or a sport. I've tried hard not to skip any steps in this tutorial; but you'll have to do your part, by not missing any part of the tutorial.


(2 be continued; more chapters even; this is a W.I.P. --Work in Progress)

Announcement: Next tutorial will be about texturing, and it will rely on many of the unwrapping tricks we used in this tutorial, such as having the front of the ship facing left on the texture, etceteras...