二維紋理 Texture 2D

Textures bring your MeshesParticles, and interfaces to life! They are image or movie files that you lay over or wrap around your objects. As they are so important, they have a lot of properties. If you are reading this for the first time, jump down to Details, and return to the actual settings when you need a reference.

紋理使你的網格、粒子、和界面更生動!它們是你覆蓋或環繞着對象的圖片或影片文件。由於它們是如此的重要,它們有很多的屬性。如果你是第一次閱讀這一點,跳到細節,當你需要一個參考時返回到實際設置。

The shaders you use for your objects put specific requirements on which textures you need, but the basic principle is that you can put any image file inside your project. If it meets the size requirements (specified below), it will get imported and optimized for game use. This extends to multi-layer Photoshop or TIFF files - they are flattened on import, so there is no size penalty for your game.

用於對象的着色器可以指定所需要的紋理,但基本原則是可以放置項目中任何圖像文件。如果它符合尺寸要求(見以下說明),它將會被導入並優化。對於多層Photoshop文件或TIFF文件——它們在導入過程中被塌陷合併,所以對於遊戲沒有不利影響。

Properties 屬性

The Texture Inspector looks a bit different from most others:

紋理檢視視圖看起來與其它大多數有點不同:

The top section contains a few settings, and the bottom part contains the Texture Importer and the texture preview.

頂部包含幾個設置,底部包含了紋理導入器和紋理預覽。

  • Aniso Level 各向異性級別
    Increases texture quality when viewing the texture at a steep angle. Good for floor and ground textures, see below. 
    在一個過高角度看紋理時提高紋理質量。適用於地板與地面紋理,見下文。
  • Filter Mode 過濾模式
    Selects how the Texture is filtered when it gets stretched by 3D transformations: 
    選擇紋理通過三維變換得到拉伸時如何過濾:
  •     Point 點模式
    The Texture becomes blocky up close 紋理在近距離變成塊狀
  •     Bilinear 雙線性
    The Texture becomes blurry up close 紋理在近距離變模糊
  •     Trilinear 三線性
    Like Bilinear, but the Texture also blurs between the different mip levels 
    類似雙線性,但紋理也在不同的mipmap層次之間變模糊
    (關於mipmap,參見以前翻譯的章節Building Scenes—Using the Scene View)
  • Wrap Mode 循環模式
    Selects how the Texture behaves when tiled: 選擇紋理平鋪時的行爲:
  •     Repeat 重複
    The Texture repeats (tiles) itself 紋理重複(平鋪)本身
  •     Clamp 鉗制
    The Texture's edges get stretched 紋理的邊緣得到延伸

Texture Importer 紋理導入器

Textures all come from image files in your Project Folder. How they are imported is specified by the Texture Importer. You change these by selecting the file texture in the Project View and modifying the Texture Importer in the Inspector.

紋理素材都來自於你的項目文件夾的圖像文件。它們如何導入是由紋理導入器指定的。你通過在項目視圖中選擇紋理文件並且在檢視面板中修改紋理導入器來改變它們。

In Unity 3 we simplified for you all the settings, now you just need to select what are you going to use the texture for and Unity will set default parameters for the type of texture you have selected. Of course if you want to have total control of your texture and do specific tweaks, you can set the Texture Typeto Advanced. This will present the full set of options that you have available.

在Unity 3中我們爲你簡化了所有的設置,現在你只需要選擇你打算使用的紋理,Unity會爲你選擇的紋理類型設置默認的參數。當然,如果你想有紋理的完全控制並做具體調整,你可以設置紋理類型爲高級。這將顯示你可使用的全套選項。

  • Texture Type 紋理類型
    Select this to set basic parameters depending on the purpose of your texture. 
    選擇這個,根據紋理的用途設置基本參數。
  •     Texture 紋理
    This is the most common setting used for all the textures in general. 
    通常這是適用於所有紋理的最常用設置。
  •     Normal Map 法線貼圖
    Select this to turn the color channels into a format suitable for real-time normal mapping. For more info, seeNormal Maps
    選擇此項,將把顏色通道變成一個適合於實時法向映射的格式。欲瞭解更多信息,請參閱法線貼圖
  •     GUI 圖形用戶界面
    Use this if your texture is going to be used on any HUD/GUI Controls. 
    如果你的紋理是要用於任何HUD(平面顯示器) / GUI的控制,使用該項。
  •     Reflection 反射
    Also known as Cube Maps, used to create reflections on textures. check Cubemap Textures for more info. 
    也稱爲立方體貼圖,用於創建紋理的反射。更多信息查詢立方體貼圖紋理
  •     Cookie
    This sets up your texture with the basic parameters used for the Cookies of your lights 
    這將設置帶基本參數的紋理用於你的光源的Cookie
  •     Advanced 高級
    Select this when you want to have specific parameters on your texture and you want to have total control over your texture. 
    當你想要有紋理的具體參數並想擁有紋理的完全控制的時候選擇該項。


Basic Texture Settings Selected 基本紋理設置選項

  • Generate Alpha From Grayscale
    從灰度產生Alpha
    If enabled, an alpha transparency channel will be generated by the image's existing values of light & dark. 
    如果啓用,將依據圖像的現有明暗值產生一個alpha透明度通道。


Normal Map Settings in the Texture Importer 紋理導入器中的法線貼圖設置

  • Generate from Greyscale
    從灰度產生
  • Bumpiness 凹凸
    Control the amount of bumpiness. 控制凹凸的總量
  • Filtering 過濾
    Determine how the bumpiness is calculated: 確定凹凸如何計算出來:
  •     Smooth 平滑
    This generates normal maps that are quite smooth. 
    這會產生比較平滑的法線貼圖
  •     Sharp 銳化
    Also known as a Sobel filter. this generates normal maps that are sharper than Standard. 
    也稱爲索貝爾過濾。這會產生出比標準更清晰的法線貼圖


GUI Settings for the Texture Importer 紋理導入器的GUI設置

You dont need to set any values in this case, Unity will set all the values for you.

在這種情況下你不需要設置任何值,Unity會爲你設定所有值。


Reflection Settings in the Texture Importer 理導入器的反射設置

  • Mapping 映射
    This determines how the texture will be mapped to a cubemap. 
    這將決定紋理如何映射到一個立方體貼圖上
  •     Sphere Mapped 球面映射
    Maps the texture to a "sphere like" cubemap.
    紋理映射到一個"球狀" 立方體貼圖上
  •     Cylindrical 圓柱
    Maps the texture to a cilinder, use this when you want to use reflections on objects that are like cilinders. 
    紋理映射到一個圓柱體,當你要使用類似圓柱對象的反射時,使用該項。
  •     Simple Sphere 簡單球形
    Maps the texture to a simple sphere, deforming the reflection when you rotate it.
    紋理映射到一個簡單的球形,當你旋轉它時變形反射
  •     Nice Sphere 精細球形
    Maps the texture to a sphere, deforming it when you rotate but you still can see the texture's wrap
    紋理映射到一個球形,當你旋轉它時變形,但你仍然可以看到紋理的外觀

An interesting way to add a lot of visual detail to your scenes is to use Cookies - greyscale textures you use to control the precise look of in-game lighting. This is fantastic for making moving clouds and giving an impression of dense foliage. The Light page has more info on all this, but the main thing is that for textures to be usable for cookies you just need to set the Texture Type to Cookie.

爲你的場景增添很多視覺細節的一種有趣方式是使用Cookies——灰階紋理用來控制遊戲中照明的精確外觀。這是構建移動雲層和給人茂密植物印象的一種奇妙方式。光源頁面有這一切更多的信息,主要的是,紋理要爲cookie可用,你只需要設置紋理類型爲cookie。


Cookie Settings in the Texture Importer 紋理導入器中的Cookie設置

  • Light Type 
    光源類型
    Type of light that the texture will be applied to. (This can be Spotlight, Point or Directional lights). For Directional Lights this texture will tile, so in the texture inspector, you must set the Edge Mode to Repeat; for SpotLights You should keep the edges of your cookie texture solid black in order to get the proper effect. In the Texture Inspector, set the Edge Mode to Clamp.
    紋理將應用的光源類型。(可以是聚光燈、點光源或方向光)。對於方向光紋理將平鋪,所以在紋理檢視面板中必須設置邊緣模式爲重複(Repeat);對於聚光燈,你應該保持你的cookie紋理的邊緣爲純黑色,以獲得正確的效果。在紋理檢視面板中,設置邊緣模式爲鉗制(Clamp)
  • Generate Alpha from Greyscale 
    從灰度產生Alpha
    If enabled, an alpha transparency channel will be generated by the image's existing values of light & dark.
    如果啓用,將依據圖像的現有明暗值產生一個alpha透明度通道。


The Advanced Texture Importer Settings dialog 高級紋理導入器設置對話框

  • Non Power of 2 
    不是2的冪
    If texture has non-power-of-two size, this will define a scaling behavior at import time (for more info see the Texture Sizes section below):
    如果紋理大小不是2的冪,這將定義在導入時的縮放行爲(更多信息請參閱下文紋理尺寸部分):
  •     None 
    Texture will be padded to the next larger power-of-two size for use with GUITexture component. 
    紋理將被填充到下一個較大的2的冪大小以便與GUI紋理組件使用。(真彆扭!)
  •     To nearest 到最近的
    Texture will be scaled to the nearest power-of-two size at import time. For instance 257x511 texture will become 256x512. Note that PVRTC formats require textures to be square (width equal to height), therefore final size will be upscaled to 512x512. 
    紋理在導入時將被縮放到最近的冪大小。例如257x511紋理將成爲256x512。請注意,PVRTC格式要求紋理是正方形(寬度與高度相等),因此最終大小將變換到512x512。 PVRTC是一種有損的紋理壓縮技術,主要用於iPhone,iPod touch和iPad。
  •     To larger 到較大的
    Texture will be scaled to the next larger power-of-two size at import time. For instance 257x511 texture will become 512x512. 
    紋理在導入時將被縮放到下一個較大的冪大小。例如257x511紋理將成爲512x512。
  •     To smaller 到較小的
    Texture will be scaled to the next smaller power-of-two size at import time. For instance 257x511 texture will become 256x256. 
    紋理在導入時將被縮放到下一個較小的冪大小。例如257x511紋理將成爲256x256。
  • Generate Cube Map 生成立方貼圖
    Generates a cubemap from the texture using different generation methods. 
    使用不同的生成方法從一個紋理生成一個立方體貼圖。
  • Read/Write Enabled
    讀/寫 啓用
    Select this to enable access to the texture data from scripts (GetPixels, SetPixels and other Texture2D functions). Note however that a copy of the texture data will be made, doubling the amount of memory required for texture asset. Use only if absolutely necessary. Disabled by default. 
    選擇此項將允許從腳本(GetPixels,SetPixels和其他Texture2D函數)訪問紋理數據。但是注意,一個紋理數據副本將產生,由此必將爲紋理資源消耗雙倍的內存量。只有在絕對必要時使用。默認情況下禁用。
  • Generate Mip Maps 
    生成Mip Maps
    Select this to enable mip-map generation. Mip maps are smaller versions of the texture that get used when the texture is very small on screen. For more info, see Mip Maps below. 
    選擇此項將啓用Mipmap生成。當紋理在屏幕上非常小的時候,Mipmaps是可供使用的紋理的較小版本。欲瞭解更多信息,請參閱下文的Mip maps。
  • Correct Gamma 校正伽馬
    Select this to enable per-mip-level gamma correction. 
    選擇此項,啓用每Mip級別伽瑪校正。
  • Border Mip Maps
    邊緣Mip Maps
    Select this to avoid colors seeping out to the edge of the lower Mip levels. Used for light cookies (see below). 
    選擇此項爲了避免色彩滲出到mip較低層次的邊緣。用於光源cookies(見下文)。
  • Mip Map Filtering 
    Mip Map過濾
    Two ways of mip map filtering are available to optimize image quality: 
    mip map過濾的兩種方式可供優化圖像質量:
  •     Box 
    The simplest way to fade out the mipmaps - the mip levels become smoother and smoother as they go down in size. 
    最簡單的方式淡出mipmap – 隨着尺寸的減小mip級別變得更平滑。
  •     Kaiser 凱撒
    A sharpening Kaiser algorithm is run on the mip maps as they go down in size. If your textures are too blurry in the distance, try this option. 
    凱撒算法是隨着尺寸的減小銳化mip maps運行。如果你的紋理在遠距離變模糊,試試這個選項。
  • Fade Out Mips 
    淡出Mips
    Enable this to make the mipmaps fade to gray as the mip levels progress. This is used for detail maps. The left most scroll is the first mip level to begin fading out at. The rightmost scroll defines the mip level where the texture is completely grayed out 
    啓用此項將使mipmaps隨着mip級別的進展褪色爲灰色,這個用於細節貼圖。最左邊的滾動條是開始淡出的第一個mip級別。最右邊的滾動條定義mip級別在哪裏完全變灰。
  • Generate Normal Map 
    生成法線貼圖
    Enable this to turn the color channels into a format suitable for real-time normal mapping. For more info, see Normal Maps, below. 
    啓用此項將轉變顏色通道成一個適合於實時法線貼圖的格式。欲瞭解更多信息,請參閱法線貼圖,如下。
  • Bumpiness 凹凸
    Control the amount of bumpiness. 控制凹凸的額度。
  • Filtering 過濾
    Determine how the bumpiness is calculated: 確定凹凸如何計算出來:
  •     Smooth 平滑
    This generates normal maps that are quite smooth. 
    這會產生比較平滑的法線貼圖。
  •     Sharp 銳化
    Also known as a Sobel filter. this generates normal maps that are sharper than Standard. 
    也稱爲索貝爾過濾。這會產生出比標準更清晰的法線貼圖。
  • Normal Map 法線貼圖
    Select this if you want to see how the normal map will be applied to your texture. 
    如果你想了解法線貼圖如何被應用到你的紋理,選擇此項。
  • Lightmap 光照貼圖
    Select this if you want to use the texture as a lightmap.
    如果你想作爲光照貼圖使用紋理,選擇此項。

Per-Platform Overrides 按平臺覆蓋

When you are building for different platforms, you have to think on the resolution of your textures for the target platform, the size and the quality. With Unity 3 you can override these options and assign specific values depending on the platform you are deploying to. Note that if you don't select any value to override, the Editor will pick the default values when building your project.

當你在不同的平臺構建(遊戲),你必須考慮爲目標平臺決定你的紋理,尺寸和質量。使用Unity3,你可以覆蓋這些選項,並根據你要部署的平臺指定具體的值。注意,當你構建項目時,如果你沒有選擇任何值覆蓋,編輯器會選擇默認值。


Default settings for all platforms. 所有平臺的默認設置

  • Max Texture Size 
    最大紋理尺寸
    The maximum imported texture size. Artists often prefer to work with huge textures - scale the texture down to a suitable size with this. 
    導入紋理的最大尺寸。美工師往往更願意使用巨大的紋理——用這個調整紋理降到合適的大小。
  • Texture Format 紋理格式
    What internal representation is used for the texture. This is a tradeoff between size and quality. In the examples below we show the final size of a in-game texture of 256 by 256 pixels: 
    用於紋理的內部表示。這是一個大小和質量之間的權衡。在下面的例子中我們展示了一個256 x 256像素的紋理的最終尺寸:
  •     Compressed 壓縮
    Compressed RGB texture. This is the most common format for diffuse textures. 4 bits per pixel (32 KB for a 256x256 texture). 
    壓縮RGB紋理,這是最常見的漫反射紋理格式。每像素4位(256x256的紋理大小爲32 KB)。(4位就只有16種顏色)
  •     16 bit
    Low-quality truecolor. Has 16 levels of red, green, blue and alpha. 
    低質量的真彩色。擁有16個級別的紅、綠、藍和alpha。
  •     Truecolor 真彩色
    Truecolor, this is the highest quality. At 256 KB for a 256x256 texture. 
    真彩色,這是最高的質量。256x256的紋理大小爲256 KB。(32位色彩)

If you have set the Texture Type to Advanced then the Texture Format has different values.

如果你已設置了紋理類型爲高級,則紋理格式會有不同的值。

Desktop
  • Texture Format紋理格式
    What internal representation is used for the texture. This is a tradeoff between size and quality. In the examples below we show the final size of an in-game texture of 256 by 256 pixels:
    用於紋理的內部格式。在大小和質量之間權衡。在下列的例子中,我們使用了在遊戲中紋理的最終大小爲256x256像素。
  •     RGB Compressed DXT1
    Compressed RGB texture. This is the most common format for diffuse textures. 4 bits per pixel (32 KB for a 256x256 texture).
    壓縮的RGB紋理。這是最常見的漫反射紋理格式。4位/像素(32 KB 256x256)
  •     RGBA Compressed DXT5
    Compressed RGBA texture. This is the main format used for diffuse & specular control textures. 1 byte/pixel (64 KB for a 256x256 texture).
    壓縮的RGBA紋理。這是漫反射和高光控制紋理的主要格式。1 字節/像素(64 KB 256x256)
  •     RGB 16 bit
    65 thousand colors with no alpha. Compressed DXT formats use less memory and usually look better. 128 KB for a 256x256 texture.
    65萬顏色不帶alpha。壓縮的DXT格式使用較少的內存,通常會更好看。(128 KB 256x256)
  •     RGB 24 bit
    Truecolor but without alpha. 192 KB for a 256x256 texture.
    真彩色不帶alpha。(192 KB 256x256)
  •     Alpha 8 bit
    High quality alpha channel but without any color. 64 KB for a 256x256 texture.
    高質量alpha通道,不帶顏色。(64 KB 256x256)
  •     RGBA 16 bit
    Low-quality truecolor. Has 16 levels of red, green, blue and alpha. Compressed DXT5 format uses less memory and usually looks better. 128 KB for a 256x256 texture.
    低質量真彩色。有16級紅,綠,藍和alpha。壓縮的DXT5格式使用較少的內存,通常會更好看。(128 KB 256x256)
  •     RGBA 32 bit
    Truecolor with alpha - this is the highest quality. At 256 KB for a 256x256 texture, this one is expensive. Most of the time, DXT5 offers sufficient quality at a much smaller size. The main way this is used is for normal maps, as DXT compression there often carries a visible quality loss.
    高質量真彩色帶alpha(256 KB 256x256),這個文件很大。大多數情況下,DXT5提供足夠的質量,文件大小要小得多。這個主要用於法線貼圖,DXT壓縮往往帶有一個可見的質量損失。
iOS
  • Texture Format
    What internal representation is used for the texture. This is a tradeoff between size and quality. In the examples below we show the final size of a in-game texture of 256 by 256 pixels:
    用於紋理的內部格式。在大小和質量之間權衡。在下列的例子中,我們使用了在遊戲中紋理的最終大小爲256x256像素。
  •     RGB Compressed
    PVRTC 4 bits Compressed RGB texture. This is the most common format for diffuse textures. 4 bits per pixel (32 KB for a 256x256 texture)
    PVRTC 4位,壓縮的RGB紋理。這是最常見的漫反射紋理格式。4位/像素(32 KB 256x256)
  •     RGBA Compressed PVRTC 4 bits
    Compressed RGBA texture. This is the main format used for diffuse & specular control textures or diffuse textures with transparency. 4 bits per pixel (32 KB for a 256x256 texture)
    壓縮的RGBA紋理。這是漫反射和高光控制紋理的主要格式。4 位/像素(32 KB 256x256)
  •     RGB Compressed PVRTC 2 bits
    Compressed RGB texture. Lower quality format suitable for diffuse textures. 2 bits per pixel (16 KB for a 256x256 texture)
    壓縮的RGB紋理。 低質量格式,適用於漫反射紋理。2 位/像素(16 KB 256x256)
  •     RGBA Compressed PVRTC 2 bits
    Compressed RGBA texture. Lower quality format suitable for diffuse & specular control textures. 2 bits per pixel (16 KB for a 256x256 texture)
    壓縮的RGBA紋理。 低質量格式,適用於漫反射紋理和高光控制紋理。2 位/像素(16 KB 256x256)
  •     RGB Compressed DXT1
    Compressed RGB texture. This format is not supported on iOS, but kept for backwards compatibility with desktop projects.
    壓縮的RGB紋理。 在iOS不支持此格式,但爲桌面項目保持向後兼容性。
  •     RGBA Compressed DXT5
    Compressed RGBA texture. This format is not supported on iOS, but kept for backwards compatibility with desktop projects.
    壓縮的RGBA紋理。在iOS不支持此格式,但爲桌面項目保持向後兼容性。
  •     RGB 16 bit
    65 thousand colors with no alpha. Uses more memory than PVRTC formats, but could be more suitable for UI or crisp textures without gradients. 128 KB for a 256x256 texture.
    65萬顏色不帶alpha。比PVRTC格式使用更多的內存,但更適用於UI或不帶漸變的明快的紋理。128 KB 256x256
  •     RGB 24 bit
    Truecolor but without alpha. 192 KB for a 256x256 texture.
    真彩色不帶alpha。(192 KB 256x256)
  •     Alpha 8 bit
    High quality alpha channel but without any color. 64 KB for a 256x256 texture.
    高質量alpha通道,不帶顏色。(64 KB 256x256)
  •     RGBA 16 bit
    Low-quality truecolor. Has 16 levels of red, green, blue and alpha. Uses more memory than PVRTC formats, but can be handy if you need exact alpha channel. 128 KB for a 256x256 texture.
    低質量真彩色。具有16級的紅、綠、藍和alpha。比PVRTC格式使用更多的內存,但如果需要精確的alpha通道,會更方便。(128 KB 256x256)
  •     RGBA 32 bit
    Truecolor with alpha - this is the highest quality. At 256 KB for a 256x256 texture, this one is expensive. Most of the time, PVRTC formats offers sufficient quality at a much smaller size.
    真彩色帶alpha - 這是最高質量。256KB 256x256,這個是很消耗性能的。大多數情況下,PVRTC格式提供足夠的質量,但有更小的文件大小。
Android
  • Texture Format
    What internal representation is used for the texture. This is a tradeoff between size and quality. In the examples below we show the final size of a in-game texture of 256 by 256 pixels:
    用於紋理的內部格式。在大小和質量之間權衡。在下列的例子中,我們使用了在遊戲中紋理的最終大小爲256x256像素。
  •     RGB Compressed DXT1
    Compressed RGB texture. Supported by Nvidia Tegra. 4 bits per pixel (32 KB for a 256x256 texture). 
    壓縮的RGB紋理。支持Nvidia Tegra。4位/像素(32 KB 256x256) ;
  •     RGBA Compressed DXT5
    Compressed RGBA texture. Supported by Nvidia Tegra. 6 bits per pixel (64 KB for a 256x256 texture).
    壓縮的RGBA紋理。支持Nvidia Tegra。6位/像素(64 KB 256x256) ;
  •     RGB Compressed ETC 4 bits
    Compressed RGB texture. This is the default texture format for Android projects. ETC1 is part of OpenGL ES 2.0 and is supported by all OpenGL ES 2.0 GPUs. It does not support alpha. 4 bits per pixel (32 KB for a 256x256 texture)
    壓縮的RGB紋理。這是Android工程默認的紋理格式。ETC1是OpenGL ES 2.0標準的一部分,並且支持所有的OpenGL ES 2.0 GPU,但它不支持Alpha。4位/像素(32 KB 256x256)
  •     RGB Compressed PVRTC 2 bits
    Compressed RGB texture. Supported by Imagination PowerVR GPUs. 2 bits per pixel (16 KB for a 256x256 texture)
    壓縮的RGB紋理。 支持Imagination PowerVR GPU。2位/像素(16 KB 256x256)
  •     RGBA Compressed PVRTC 2 bits
    Compressed RGBA texture. Supported by Imagination PowerVR GPUs. 2 bits per pixel (16 KB for a 256x256 texture)
    壓縮的RGBA紋理。支持Imagination PowerVR GPU。2位/像素(16 KB 256x256)
  •     RGB Compressed PVRTC 4 bits
    Compressed RGB texture. Supported by Imagination PowerVR GPUs. 4 bits per pixel (32 KB for a 256x256 texture)
    壓縮的RGB紋理。 支持Imagination PowerVR GPU。4位/像素(32 KB 256x256)
  •     RGBA Compressed PVRTC 4 bits
    Compressed RGBA texture. Supported by Imagination PowerVR GPUs. 4 bits per pixel (32 KB for a 256x256 texture)
    壓縮的RGBA紋理。 支持Imagination PowerVR GPU。4位/像素(32 KB 256x256)
  •     RGB Compressed ATC 4 bits
    Compressed RGB texture. Supported by Qualcomm Snapdragon. 4 bits per pixel (32 KB for a 256x256 texture).
    壓縮的RGB紋理。 支持Qualcomm Snapdragon。4位/像素(32 KB 256x256)
  •     RGBA Compressed ATC 8 bits
    Compressed RGBA texture. Supported by Qualcomm Snapdragon. 6 bits per pixel (64 KB for a 256x256 texture).
    壓縮的RGB紋理。 支持Qualcomm Snapdragon。6位/像素(64 KB 256x256)
  •     RGB 16 bit
    65 thousand colors with no alpha. Uses more memory than the compressed formats, but could be more suitable for UI or crisp textures without gradients. 128 KB for a 256x256 texture.
    65萬顏色不帶alpha。比壓縮的格式使用更多的內存,但更適用於UI或不帶漸變的明快的紋理。128 KB 256x256
  •     RGB 24 bit
    Truecolor but without alpha. 192 KB for a 256x256 texture.
    真彩色不帶alpha。(192 KB 256x256)
  •     Alpha 8 bit
    High quality alpha channel but without any color. 64 KB for a 256x256 texture.
    高質量alpha通道,不帶顏色。(64 KB 256x256)
  •     RGBA 16 bit
    Low-quality truecolor. The default compression for the textures with alpha channel. 128 KB for a 256x256 texture.
    低質量真彩色。默認壓縮的紋理帶有alpha通道(128 KB 256x256)
  •     RGBA 32 bit
    Truecolor with alpha - this is the highest quality compression for the textures with alpha. 256 KB for a 256x256 texture.
    真彩色帶alpha - 這是高質量壓縮的紋理帶有alpha通道。(256 KB 256x256)

Unless you're targeting a specific hardware, like Tegra, we'd recommend using ETC1 compression. If needed you could store an external alpha channel and still benefit from lower texture footprint. If you absolutely want to store an alpha channel in a texture, RGBA16 bit is the compression supported by all hardware vendors.

除非你是針對一個特定的硬件,像Tegra,我們建議你使用ETC1壓縮。如果需要可以儲存額外的alpha通道並仍能得到較低的紋理佔用空間。如果你一定要儲存alpha通道在紋理中,RGBA16位是所有的硬件​​廠商所支持的壓縮。

If your app utilizes an unsupported texture compression, the textures will be uncompressed to RGBA 32 and stored in memory along with the compressed ones. So in this case you lose time decompressing textures and lose memory storing them twice. It may also have a very negative impact on rendering performance.

如果您的應用程序採用一個不支持的紋理壓縮,紋理將解壓到RGBA32並連同壓縮的那些儲存在內存中。因此,這種情況下將失去解壓紋理時間並消耗內存儲存它們兩次,也有可能非常影響渲染性能。

Details 細節

Supported Formats 支持的格式

Unity can read the following file formats: PSD, TIFF, JPG, TGA, PNG, GIF, BMP, IFF, PICT. It should be noted that Unity can import multi-layer PSD & TIFF files just fine. They are flattened automatically on import but the layers are maintained in the assets themselves, so you don't lose any of your work when using these file types natively. This is important as it allows you to just have one copy of your textures that you can use from Photoshop, through your 3D modelling app and into Unity.

Unity支持下面的文件格式:PSD, TIFF, JPG, TGA, PNG, GIF, BMP, IFF, PICT。應注意,Unity可以導入多層PSD和TIFF文件,在導入時,層將自動被塌陷,因此你不必浪費時間,直接使用源文件類型。這點很重要,允許只有一個紋理拷貝,使用從Photoshop,三維建模程序導入到Unity。

Texture Sizes 紋理大小

These sizes are as follows: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 or 2048 pixels. The textures do not have to be square, i.e. width can be different from height.

這些尺寸如下:2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 或 2048像素。紋理可不必是正方形,即寬度和高度可以不同。

It is possible to use other (non power of two) texture sizes with Unity. Non power of two texture sizes work best when used on GUI Textures, however if used on anything else they will be converted to an uncompressed RGBA 32 bit format. That means they will take up more video memory (compared to PVRT(iOS)/DXT(Desktop) compressed textures), will be slower to load and slower to render (if you are on iOS mode). In general you'll use non power of two sizes only for GUI purposes.

可以使用其他非二次方紋理尺寸,當用於GUI紋理時,非二次方紋理最好,但是,如果在別的使用,它們將被轉換爲未壓縮的RGBA32位格式。這意味着它們將使用更多的內存(相比PVRT(iOS)/DXT(Desktop)壓縮的紋理),將使較慢加載和和較慢渲染(如果是iOS模式)。一般來說,非二次方的紋理僅用於GUI。

Non power of two texture assets can be scaled up at import time using the Non Power of 2 option in the advanced texture type in the import settings. Unity will scale texture contents as requested, and in the game they will behave just like any other texture, so they can still be compressed and very fast to load.

非二次方紋理資源可以在導入時在導入設置中高級紋理類型使用Non Power of 2(非二次方)選項設置縮放。Unity將按需縮放紋理,並在遊戲中,它們的行爲就像其他紋理一樣,因此他們仍然可以被壓縮,加載非常快。

UV Mapping(UV貼圖)

When mapping a 2D texture onto a 3D model, some sort of wrapping is done. This is called UV mapping and is done in your 3D modelling app. Inside Unity, you can scale and move the texture using Materials. Scaling normal & detail maps is especially useful.

當映射一個2D紋理到一個3D模型上,要設定循環模式(平鋪方式)。這就是三維建模程序中,被稱爲UV貼圖。在Unity,可以使用Materials縮放移動紋理。縮放法線和地形細節貼圖尤其有用。

Mip Maps 多級紋理

Mip Maps are a list of progressively smaller versions of an image, used to optimise performance on real-time 3D engines. Objects that are far away from the camera use the smaller texture versions. Using mip maps uses 33% more memory, but not using them can be a huge performance loss. You should always use mipmaps for in-game textures; the only exceptions are textures that will never be minified (e.g. GUI textures).

多級紋理是逐步縮小圖像版本的一個列表,用來優化實時3D引擎的性能。遠離相機的物體使用較小的紋理版本。使用多級紋理,將多使用33%以上的內存,但不使用它們將有巨大的的性能損失。應該爲遊戲總是使用多級紋理,唯一例外的是,用於不會縮小的紋理(例如GUI紋理)。

Normal Maps 法線貼圖

Normal maps are used by normal map shaders to make low-polygon models look as if they contain more detail. Unity uses normal maps encoded as RGB images. You also have the option to generate a normal map from a grayscale height map image.

法線貼圖用於法線貼圖着色器,使低多邊形模型看起來有更多的細節。Unity使用的法線貼圖作爲RGB圖像編碼,還可以選擇從一個灰度高度圖來生成一個法線貼圖。

Detail Maps 細節貼圖

If you want to make a terrain, you normally use your main texture to show where there are areas of grass, rocks sand, etc... If your terrain has a decent size, it will end up very blurry. Detail textures hide this fact by fading in small details as your main texture gets up close.

如果想創建一個地形,通常使用主紋理來顯示那些草、巖砂區域,等等。如果地形非常大,它最終會非常模糊。細節紋理隱藏實際的淡出,小細節作爲更接近的主紋理。

When drawing detail textures, a neutral gray is invisible, white makes the main texture twice as bright and black makes the main texture completely black.

但繪製細節紋理,中性灰是不可見的,白色是主紋理兩倍亮,黑色是主紋理完全變黑。

Reflections (Cube Maps) 反射(立方體貼圖)

If you want to use texture for reflection maps (e.g. use the Reflective builtin shaders), you need to use Cubemap Textures.

如果你想使用紋理用於反射貼圖(例如使用內置的反射着色器),必須使用立方圖紋理。

Anisotropic filtering 各項異性過濾

Anisotropic filtering increases texture quality when viewed from a grazing angle, at some expense of rendering cost (the cost is entirely on the graphics card). Increasing anisotropy level is usually a good idea for ground and floor textures. In Quality Settings anisotropic filtering can be forced for all textures or disabled completely.

當從掠角(grazing angle)觀看,各向異性過濾提高紋理質量,有一些渲染成本消耗(完全是顯卡成本)。爲地面和地板紋理,增加各向異性等級通常是一個好主意。在質量設置中各向異性過濾,可以強制用於所有紋理或完全禁用。

 
No anisotropy (left) / Maximum anisotropy (right) used on the ground texture
無各向異性(左)/(右)最大各向異性應用於地面紋理。

頁面最後更新: 2007-11-16

分類:Manual翻譯: 第七把劍
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章