应用纹理

Sooner or later, you may want to use an image texture on your model. If you are using an external application, you need to know where on the mesh you are painting. You may also need to test your UV mapping with a test image. This section covers how to export an outline of your UV map, and how to load images into the UV editor.

应用纹理到UV

The UV Editor allows you to map textures directly to the mesh faces. The 3D Viewport shows you the object being textured. If you set the 3D View into Textured viewport shading, you will immediately see any changes made in the UV Editor, and vice versa. This is because no real rendering is taking place; it is all just viewport shading. If you were to apply an image to UVs then render, the texture would not show up by default.

要把贴图渲染到物体,必须:

  • Create a Material for the object.
  • Tell Blender to use the UV textures on faces when rendering.

要创建材质,在材质标签页单击 添加新的 材质即可。

有两种方法可以告诉Blender在渲染时使用UV贴图:常规方法和快捷方法。

使用UV坐标

../../../../_images/modeling_meshes_editing_uv_applying-image_coords.png

使用UV坐标映射纹理。

在贴图通道面板,添加一个新的问题,然后设置纹理为图像,载入准备好的图像。在映射面板,在左边菜单选择UV,然后选择对应的UV映射。

还要确保在影响面板勾选颜色(默认映射颜色,默认的UV纹理名称为"UVTex")。如果图像包含透明通道,并且你要用到它,还得勾选 Alpha

Full details of using Image textures are on the Image Textures page.

Note

渲染必须要有材质

You can perform UV texturing on a mesh within Blender without assigning a material, and you will even see it in your 3D View in textured viewport mode. However, when you render, you will just get a default gray if the object does not have a Material assigned. You will get a black if you do not load an image. If you do not create a texture that uses the image, your object will render according to the procedural material settings.

使用测试栅格

如果你的图像是均匀的基础图案,想要作用在模型上的图像看起来就像蒙在上面的布一样, 没有 任何拉伸(除非你想布料看起来像弹性纤维)。

../../../../_images/modeling_meshes_editing_uv_applying-image_test-grid-uvs.png

对UV应用测试栅格图。

../../../../_images/modeling_meshes_editing_uv_applying-image_test-grid-geometry.png

在几何体上预览贴图。

渲染时,网格中的测试网格替换为颜色,UV贴图的大小也需要与你指定的图像尺寸一样。

修改图像纹理

保存贴图为单独文件的好处是你可以通过覆盖图像文件轻松切换贴图,并且使用外部程序处理贴图。打包的好处是整个工程都存在一个blend文件中,你需要管理一个文件。