Doc:JA/2.4/Manual/Textures/UV

提供: wiki
移動先: 案内検索

3Dオブジェクト上で2Dテクスチャをマッピングする最も柔軟性の高い方法は「UVマッピング」と呼ばれる方法です。この方法では、3次元メッシュ(XYZ座標)を平らな2次元テクスチャ(UV座標)に対応付けたりアンラップしたりします。画像の色はこのようにメッシュにマッピングされ、メッシュの面の色として表示されます。UVテクスチャを使うことで、手続きマテリアルとテクスチャ(訳がよく分からないので直訳しました:"procedural materials and textures")にはないリアリズムと頂点ペイント以上の細かさを得られます。

UVの説明

ボックスの検査
ボックスの2次元マップ

UVマッピングとは例えるならばダンボール箱を切り開くようなものです。箱はシーンに追加されたメッシュキューブと同じような3次元オブジェクトです。

もし鋏で箱を切り開くならば、それを机の上に置くことが出来ます。机上のの箱を見下ろすように、Uを左右方向、Vを上下方向といえます。つまりこれは二次元画像です。3次元空間のX,Yの代わりにこれら「テクスチャ座標空間」を参照するためにU,Vを使います。

ボックスが再構成されるときに、紙の上のUV座標はボックスのXYZ座標に転送されます。これはコンピュータが3Dオブジェクトの周りを2D画像で包んでいるようなものです。

UVアンラッピング作業中に、Blenderにオブジェクト(ここではボックス)の面がUV画像エディタウィンドウの2次元画像にどのようにマッピングするか正確に指示してください。この方法については完全に自由です。(この例で言うと、まずボックスを机上に切り開き、さらに小さな破片に切り、その破片を何らかの方法で引き伸ばしたりして同じ机上の写真に対応させていくと想像してください)

地図作成の例

Cartographers (map makers) have been dealing with this problem for millennia. A cartography (map-making) example is creating a projection map of the whole world. In cartography, we take the surface of the earth (a sphere) and make a flat map that can be folded up into the glove compartment aboard the space shuttle. We 'fill in' spaces toward the poles, or change the outline of the map in any of several ways:

Mercator Projection
Mollweide Projection
Albers-equal Projection

Each of these is an example of a way to UV map a sphere. Each of the hundred or so commonly accepted projections has its advantages and disadvantages. Blender allows us to do the same thing any way we want to, on the computer.

On more complex models (like seen in the earth map above) there pops up an issue where the faces can't be 'cut', but instead they are stretched in order to make them flat. This helps making easier UV maps, but sometimes adds distortion to the final mapped texture. (Countries and states that are closer to the North or the South Pole look smaller on a flat map than do ones which are close to the Equator.)

半球の例

3D Space (XYZ) versus UV Space (click to enlarge)

In this image you can easily see that the shape and size of the marked face in 3D space is different in UV space.

This difference is caused by the 'stretching' (technically called mapping) of the 3D part (XYZ) onto a 2D plane (i.e the UV map).

If a 3D object has a UV map, then, in addition to the 3D-coordinates X, Y, and Z, each point on the object will have corresponding U and V coordinates. (P in the image above is an example of how a point on a 3D object might be mapped onto a 2D image.)

利点

While procedural textures (described in the previous chapters) are useful-they never repeat themselves and always "fit" 3D objects-they are not sufficient for more complex or natural objects. For instance, the skin on a human head will never look quite right when procedurally generated. Wrinkles on a human head, or scratches on a car do not occur in random places, but depend on the shape of the model and its usage. Manually-painted images, or images captured from the real world gives more control and realism. For details such as book covers, tapestry, rugs, stains, and detailed props, artists are able to control every pixel on the surface using a UV Texture.

A UV map describes what part of the texture should be attatched to each polygon in the model. Each polygon's vertex gets assigned to 2D coordinates that define which part of the image gets mapped. These 2D coordinates are called UVs (compare this to the XYZ coordinates in 3D). The operation of generating these UV maps is also called "unwrap", since it is as if the mesh were unfolded onto a 2D plane.

For most simple 3D models, Blender has an automatic set of unwrapping algorithms that you can easily apply. For more complex 3D models, regular Cubic, Cylindrical or Spherical mapping, is usually not sufficient. For even and accurate projection, use seams to guide the UV mapping. This can be used to apply textures to arbitrary and complex shapes, like human heads or animals. Often these textures are painted images, created in applications like the Gimp, Photoshop, or your favorite painting application.

Games
UV mapping is also essential in the Blender game engine, or any other game. It is the de facto standard for applying textures to models; almost any model you find in a game is UV mapped.