Difference between revisions of "HowTo:FullUnwrapStarkOp"

From VsWiki
Jump to: navigation, search
Line 51: Line 51:
 
=== The Trick ===
 
=== The Trick ===
  
 +
The trick consists of the following steps:
 +
# Unwrap half the ship (without Apply-ing the Mirror Attribute), but only onto half of the UV texture space.
 +
# Apply the Mirror Attribute.
 +
# Select the newly created half of the ship
 +
# Move its UV layout islands as a block to the unused half of the UV texture space
 +
# Mirror its UV layout as a block, so as to restore proper clockwise order of the vertices.
  
  
.......
+
=== The general layout ===
 
 
http://deeplayer.com/wiki/tut/FullUV/blender_shot89.jpg
 
  
 
(to be continued)
 
(to be continued)

Revision as of 20:26, 12 May 2007

A Stark Choice

First, you have a delicate descision to make: To mirror, or NOT to mirror.

Assuming your mesh is mirrored in X (i.e.: your mesh object has the Mirror attribute turned on), to unwrap it as-is makes the unwrap itself "mirrored"; and to unwrap it un-mirrored you have to first Apply the Mirror attribute.

If your ship is NOT mirrored, --presumably because it's not supposed to be symmetric--, then you don't have to deal with this question; you are forced to unwrap it un-mirrored.

What you cannot do as of this writing (with the Vegastrike engine and Blender as they are) is to mix mirrored and un-mirrored unwrapping, or to overlap some of the uv islands but not all. This is because Blender's ambient occlusion baking adds light from different mesh areas using the same area of the texture; which is fine if ALL areas are used twice (just a matter of defining the ambient light as 50% grey), but otherwise making much brighter overlapped than non-overlapped UV islands.

So, basically, we have two choices: Mirror the whole ship's UV mapping, using every UV island exactly twice; or not mirror at all: make each UV island represent a unique area on the mesh.

But as for the not too distant future, the VS engine may start using something smarter than ambient illumination baked into the glow texture: Global Illumination, or "GI"; which would give us a more dynamic kind of ambient occlusion, with soft-edged shadows from self-shadowing, sensitive the dynamic, global light distribution. But GI uses two extra textures, called PRTN and PRTP, which require a special baking setup in Blender, and together encode light contributions from all 6 orthogonal directions, to each texel. But these PRT's cannot use a mirrored UV-mappings, or any kind of UV island overlap, at all. Note, however, that these PRT's won't need to be big textures. Typically they'd be one half or one quarter the resolution of the diffuse and specular textures.

But also, in the not too distant future, we'll have dual UV-mapping (two UV-coords per vertex in the mesh file) So, we could then have high rez textures using a highly mirrored and overlapped UV-mapping, and PRT's using a non-mirrored and non-overlapped UV mapping. Blender already supports multiple UV's per vertex, although, yes: I'm afraid this would place on us the extra burden of producing two UV-unwraps for each mesh; but the results should be spectacular.


To put the current situation in summary form:

If your ship is non-symmetric, and therefore you don't have a Mirror Attribute on your mesh, you're probably best off making a full ship UV mapping, without any UV island sharing. If your ship is symmetrical and you have the mesh itself mirrored, you have a difficult descision to make: Do you unwrap it as is --i.e.: unwrap half of the ship and then apply the mirroring, so that the other half has the same UV coords as the first, or to apply the mirroring first and do a full mesh unwrap. (And there's a third option I'll mention later.)

Here's the advantages for each:


Mirrored's Pro's:

  1. It is easier (half as much work), to unwrap.
  2. Packs twice as much detail in a given texture.

Mirrored's Con's:

  1. The two sides of the ship look exactly the same: Which means that near the middle line, a scratch on one side will be mirrored exactly on the other, so one has to avoid putting such circumstantial or accidental details where they can be seen on both sides of the ship. like, say, from above it; forcing you to have a central band of featurelessness or risk making the mirroring too obvious.
  2. The two sides are mirror images of each other: Readable text in one side of the ship will read backwards on the other side.
  3. You may face some trouble with tangent space normal mapping, which tends to produce inverted results when the clockwise order of the UV vertices is inverted, as it is in the mirrored side of the ship. xNormal, a free program to bake normal maps from supplied coarse and fine meshes, supposedly now handles mirroring; but I have not tried the feature yet, myself; and I'm not sure I imagine how it works when combined with a supplied bumpmap.
  4. Wasted work as far as future engine feature compatibility is concerned: A mirrored unwrap isn't only useless as a PRT UV-mapping; it is also not exactly optimal for the diffuse- and specular-only UV unwrap; because for that unwrap you'd probably want to mirror some items in X AND Y, or even in X, Y and Z; and you may have repeating greebles that could use the same UV-island a dozen times. Once we have dual UV coords and can depend on the non-overlapped mapping for things like PRT and normal mapping, we can essentially do anything we want with the other unwrap. So, in a nutshell, your mirrored UV unwrapping is destined for the recycle bin, eventually.

Un-mirrored Pro's:

  1. It's un-mirrored :D, which means, you can have a scratch just to the left of the middle line of the ship that doesn't show on the right of it; and you can have text that reads properly anywhere around the ship.
  2. No trouble with tangent space normal mapping.
  3. No trouble with PRT's
  4. Forward compatible with dual UV-mappings: Your unwrap will simply become the "PRT unwrap", and you'll have just one more unwrapping to add; --namely, the mirrored and higly UV-island re-use mapping.

Un-mirrored Con's:

  1. Less efficient, from the point of view that the left and right sides of a symmetrical ship are almost identically textured, so we're sort duplicating a lot of info. However, the accent is on "almost"...
  2. More work. However, there's tricks we can use to lighten our burden. See below.


The promised third option:

      • NOT recommended though.*** One can have a mirrored texturing, but leave some room in it; then un-mirror the ship, and then UV-unwrap a few items so that they aren't mirrored, such as special places to put writing on. The reason I don't recommend this is you will still have to deal with ambient occlusion baking snafus that are manageable but which I don't intend to write a tutorial for. And all the other con's of mirrored UV mappings are still applicable.


If it's not clear from all the above, I am biased towards non-mirrored UV-unwrapping :D; and therefore, for this tutorial, I will do a full, un-mirrored unwrap. However, I'm as lazy as the next guy, and I will use a trick to do half as much work as unwraping the whole, un-mirrored mesh.


The Trick

The trick consists of the following steps:

  1. Unwrap half the ship (without Apply-ing the Mirror Attribute), but only onto half of the UV texture space.
  2. Apply the Mirror Attribute.
  3. Select the newly created half of the ship
  4. Move its UV layout islands as a block to the unused half of the UV texture space
  5. Mirror its UV layout as a block, so as to restore proper clockwise order of the vertices.


The general layout

(to be continued)