HowTo:FullUnwrap3Materials

From VsWiki
Jump to: navigation, search

Materialize it (i.e.: assign materials (--i.e.: colors))

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.



I got a question from a friend by email:

I started to follow your tutorial, but I'm a tad confused. You're saying to color the areas by way of blender's materials,
so you know the best way to group them when unwrapping; but before doing that, you join all of the object into one.
I'm currently unaware of a way to select only a portion of an object and assign it a material. Am I missing something?

My reply:

I'm afraid it sounds like you are missing something BIG...

Blender allows you to assign up to 16 materials per object.
To add a material to an object, follow this procedure:

1) Select a facet or group of facets whom you want to assign the new material.
2) F9
3) In the materials panel, click on the New button.
4) F5
5) IMPORTANT: Where it says "Link to object: MA:whatever", click on the icon on the left and select ADD NEW
6) IMPORTANT: The new material's default name is MA:whatever.001"; rename it to "Gold" or whatever...
7) Play with the material colors, hardness, etceteras
8) IMPORTANT: F9 again
9) IMPORTANT: Click on the Assign button.


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.


Cutter21.jpg

Cutter22.jpg

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.

Another use for matte materials is large flat surfaces. Environment mapping is a clever and efficient but crude way of simulating specularities. If you make a large, flat surface specular, you're really putting the limelight on its crudity. I avoid that like the plague. The best use of specularity is for curved surfaces. The more curved the better. That way, all your eyes see is these distorted patterns and highlights moving about in weird ways, looking very much like reflections. But if you have a large surface reflecting, they you would expect to see a reflected "image"; and you kind of see one, the sky-box; but pixelated and horrible, not like what you'd expect a reflection to look like, at all.

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:


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...


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.

In any case, I'd advise you to play with different color schemes until you know you won't be changing your mind...


Cutter26.jpg

Cutter27.jpg

Cutter28.jpg

Cutter29.jpg

Cutter30.jpg

Cutter31.jpg


... because once you've grouped your UV islands by material, changes to the color scheme may force you to reorganize your groups, or else to allow the grouping to be compromised.

During this process you may spot a lot of mesh errors and possible optimizations...