朱峰社區(qū)首頁 朱峰社區(qū)

搜索資源 注冊|登陸

等待

返回 展開菜單
按功能 按軟件

Unity3D游戲制作教程

Unity3D游戲制作教程

包含5節(jié)視頻教程

本系列包含Unity3D介紹、Unity3D導(dǎo)出人物、Unity3D導(dǎo)出場景、Unity3D導(dǎo)出動作、游戲測試最終完成一個簡單的游戲。是一套非常完整的Unity3D游戲制作教程。

關(guān)閉

Unity組件:Texture 2D二維紋理

關(guān)注:894 留言:0 樓主:s00sss003 發(fā)帖時間:15年11月16日

s00sss003

普通會員

s00sss003

社區(qū)新人:1級

關(guān)注3350人

  • 性別

  • 年齡

    18

  • 積分

    1

  • 登陸

    1

  • 發(fā)帖

    2

間隔線


Textures
bring your Meshes, Particles, 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.

紋理使你的網(wǎng)格、粒子、和界面更生動!它們是你覆蓋或環(huán)繞著對象的圖片或電影文件。由于它們是如此的重要,它們有很多的屬性。如果你是第一次閱讀這一點,跳到細(xì)節(jié),當(dāng)你需要一個參考時返回到實際設(shè)置。

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.

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

Properties 屬性

The Texture Inspector looks a bit different from most others:

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

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

頂部包含幾個設(shè)置,底部包含了紋理導(dǎo)入器和紋理預(yù)覽。

  • Aniso Level 各向異性級別
    Increases texture quality when viewing the texture at a steep angle. Good for floor and ground textures, see below.
    在一個過高角度看紋理時提高紋理質(zhì)量。適用于地板與地面紋理,見下文。
  • 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層次之間變模糊
    (關(guān)于mipmap,參見以前翻譯的章節(jié)Building Scenes—Using the Scene View)
  • Wrap Mode 循環(huán)模式
    Selects how the Texture behaves when tiled: 選擇紋理平鋪時的行為:
  •     Repeat 重復(fù)
    The Texture repeats (tiles) itself 紋理重復(fù)(平鋪)本身
  •     Clamp 鉗制
    The Texture's edges get stretched 紋理的邊緣得到延伸
Texture Importer 紋理導(dǎo)入器

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.

紋理素材都來自于你的項目文件夾的圖像文件。它們?nèi)绾螌?dǎo)入是由紋理導(dǎo)入器指定的。你通過在項目視圖中選擇紋理文件并且在檢視面板中修改紋理導(dǎo)入器來改變它們。

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 Type to Advanced. This will present the full set of options that you have available.

在Unity 3中我們?yōu)槟愫喕怂械脑O(shè)置,現(xiàn)在你只需要選擇你打算使用的紋理,Unity會為你選擇的紋理類型設(shè)置默認(rèn)的參數(shù)。當(dāng)然,如果你想有紋理的完全控制并做具體調(diào)整,你可以設(shè)置紋理類型為高級。這將顯示你可使用的全套選項。

  • Texture Type 紋理類型
    Select this to set basic parameters depending on the purpose of your texture.
    選擇這個,根據(jù)紋理的用途設(shè)置基本參數(shù)。
  •     Texture 紋理
    This is the most common setting used for all the textures in general.
    通常這是適用于所有紋理的最常用設(shè)置。
  •     Normal Map 法線貼圖
    Select this to turn the color channels into a format suitable for real-time normal mapping. For more info, see Normal 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.
    也稱為立方體貼圖,用于創(chuàng)建紋理的反射。更多信息查詢立方體貼圖紋理
  •     Cookie
    This sets up your texture with the basic parameters used for the Cookies of your lights
    這將設(shè)置帶基本參數(shù)的紋理用于你的光源的Cookie
  •     Advanced 高級
    Select this when you want to have specific parameters on your texture and you want to have total control over your texture.
    當(dāng)你想要有紋理的具體參數(shù)并想擁有紋理的完全控制的時候選擇該項。


Basic Texture Settings Selected 基本紋理設(shè)置選項

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


Normal Map Settings in the Texture Importer 紋理導(dǎo)入器中的法線貼圖設(shè)置

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


GUI Settings for the Texture Importer 紋理導(dǎo)入器的GUI設(shè)置

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

在這種情況下你不需要設(shè)置任何值,Unity會為你設(shè)定所有值。


Reflection Settings in the Texture Importer 理導(dǎo)入器的反射設(shè)置

  • 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.
    紋理映射到一個圓柱體,當(dāng)你要使用類似圓柱對象的反射時,使用該項。
  •     Simple Sphere 簡單球形
    Maps the texture to a simple sphere, deforming the reflection when you rotate it.
    紋理映射到一個簡單的球形,當(dāng)你旋轉(zhuǎn)它時變形反射
  •     Nice Sphere 精細(xì)球形
    Maps the texture to a sphere, deforming it when you rotate but you still can see the texture's wrap
    紋理映射到一個球形,當(dāng)你旋轉(zhuǎn)它時變形,但你仍然可以看到紋理的外觀

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.

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


Cookie Settings in the Texture Importer 紋理導(dǎo)入器中的Cookie設(shè)置

  • 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.
    紋理將應(yīng)用的光源類型。(可以是聚光燈、點光源或方向光)。對于方向光紋理將平鋪,所以在紋理檢視面板中必須設(shè)置邊緣模式為重復(fù)(Repeat);對于聚光燈,你應(yīng)該保持你的cookie紋理的邊緣為純黑色,以獲得正確的效果。在紋理檢視面板中,設(shè)置邊緣模式為鉗制(Clamp)
  • Generate Alpha from Greyscale
    從灰度產(chǎn)生Alpha
    If enabled, an alpha transparency channel will be generated by the image's existing values of light & dark.
    如果啟用,將依據(jù)圖像的現(xiàn)有明暗值產(chǎn)生一個alpha透明度通道。


The Advanced Texture Importer Settings dialog 高級紋理導(dǎo)入器設(shè)置對話框

  • 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的冪,這將定義在導(dǎo)入時的縮放行為(更多信息請參閱下文紋理尺寸部分):
  •     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.
    紋理在導(dǎo)入時將被縮放到最近的冪大小。例如257x511紋理將成為256x512。請注意,PVRTC格式要求紋理是正方形(寬度與高度相等),因此最終大小將變換到512x512。 PVRTC是一種有損的紋理壓縮技術(shù),主要用于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.
    紋理在導(dǎo)入時將被縮放到下一個較大的冪大小。例如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.
    紋理在導(dǎo)入時將被縮放到下一個較小的冪大小。例如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函數(shù))訪問紋理數(shù)據(jù)。但是注意,一個紋理數(shù)據(jù)副本將產(chǎn)生,由此必將為紋理資源消耗雙倍的內(nèi)存量。只有在絕對必要時使用。默認(rèn)情況下禁用。
  • 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生成。當(dāng)紋理在屏幕上非常小的時候,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過濾的兩種方式可供優(yōu)化圖像質(zhì)量:
  •     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運(yùn)行。如果你的紋理在遠(yuǎn)距離變模糊,試試這個選項。
  • 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級別的進(jìn)展褪色為灰色,這個用于細(xì)節(jié)貼圖。最左邊的滾動條是開始淡出的第一個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.
    啟用此項將轉(zhuǎn)變顏色通道成一個適合于實時法線貼圖的格式。欲了解更多信息,請參閱法線貼圖,如下。
  • Bumpiness 凹凸
    Control the amount of bumpiness. 控制凹凸的額度。
  • Filtering 過濾
    Determine how the bumpiness is calculated: 確定凹凸如何計算出來:
  •     Smooth 平滑
    This generates normal maps that are quite smooth.
    這會產(chǎn)生比較平滑的法線貼圖。
  •     Sharp 銳化
    Also known as a Sobel filter. this generates normal maps that are sharper than Standard.
    也稱為索貝爾過濾。這會產(chǎn)生出比標(biāo)準(zhǔn)更清晰的法線貼圖。
  • Normal Map 法線貼圖
    Select this if you want to see how the normal map will be applied to your texture.
    如果你想了解法線貼圖如何被應(yīng)用到你的紋理,選擇此項。
  • 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.

當(dāng)你在不同的平臺構(gòu)建(游戲),你必須考慮為目標(biāo)平臺決定你的紋理,尺寸和質(zhì)量。使用Unity3,你可以覆蓋這些選項,并根據(jù)你要部署的平臺指定具體的值。注意,當(dāng)你構(gòu)建項目時,如果你沒有選擇任何值覆蓋,編輯器會選擇默認(rèn)值。


Default settings for all platforms. 所有平臺的默認(rèn)設(shè)置

  • 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.
    導(dǎo)入紋理的最大尺寸。美工師往往更愿意使用巨大的紋理——用這個調(diào)整紋理降到合適的大小。
  • 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:
    用于紋理的內(nèi)部表示。這是一個大小和質(zhì)量之間的權(quán)衡。在下面的例子中我們展示了一個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.
    低質(zhì)量的真彩色。擁有16個級別的紅、綠、藍(lán)和alpha。
  •     Truecolor 真彩色
    Truecolor, this is the highest quality. At 256 KB for a 256x256 texture.
    真彩色,這是最高的質(zhì)量。256x256的紋理大小為256 KB。(32位色彩)

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

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

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:
    用于紋理的內(nèi)部格式。在大小和質(zhì)量之間權(quán)衡。在下列的例子中,我們使用了在游戲中紋理的最終大小為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 字節(jié)/像素(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格式使用較少的內(nèi)存,通常會更好看。(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.
    高質(zhì)量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.
    低質(zhì)量真彩色。有16級紅,綠,藍(lán)和alpha。壓縮的DXT5格式使用較少的內(nèi)存,通常會更好看。(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.
    高質(zhì)量真彩色帶alpha(256 KB 256x256),這個文件很大。大多數(shù)情況下,DXT5提供足夠的質(zhì)量,文件大小要小得多。這個主要用于法線貼圖,DXT壓縮往往帶有一個可見的質(zhì)量損失。
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:
    用于紋理的內(nèi)部格式。在大小和質(zhì)量之間權(quán)衡。在下列的例子中,我們使用了在游戲中紋理的最終大小為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紋理。 低質(zhì)量格式,適用于漫反射紋理。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紋理。 低質(zhì)量格式,適用于漫反射紋理和高光控制紋理。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格式使用更多的內(nèi)存,但更適用于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.
    高質(zhì)量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.
    低質(zhì)量真彩色。具有16級的紅、綠、藍(lán)和alpha。比PVRTC格式使用更多的內(nèi)存,但如果需要精確的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 - 這是最高質(zhì)量。256KB 256x256,這個是很消耗性能的。大多數(shù)情況下,PVRTC格式提供足夠的質(zhì)量,但有更小的文件大小。
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:
    用于紋理的內(nèi)部格式。在大小和質(zhì)量之間權(quán)衡。在下列的例子中,我們使用了在游戲中紋理的最終大小為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工程默認(rèn)的紋理格式。ETC1是OpenGL ES 2.0標(biāo)準(zhǔn)的一部分,并且支持所有的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。比壓縮的格式使用更多的內(nèi)存,但更適用于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.
    高質(zhì)量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.
    低質(zhì)量真彩色。默認(rèn)壓縮的紋理帶有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 - 這是高質(zhì)量壓縮的紋理帶有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.

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

Details 細(xì)節(jié)
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。應(yīng)注意,Unity可以導(dǎo)入多層PSD和TIFF文件,在導(dǎo)入時,層將自動被塌陷,因此你不必浪費時間,直接使用源文件類型。這點很重要,允許只有一個紋理拷貝,使用從Photoshop,三維建模程序?qū)氲経nity。

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.

可以使用其他非二次方紋理尺寸,當(dāng)用于GUI紋理時,非二次方紋理最好,但是,如果在別的使用,它們將被轉(zhuǎn)換為未壓縮的RGBA32位格式。這意味著它們將使用更多的內(nèi)存(相比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.

非二次方紋理資源可以在導(dǎo)入時在導(dǎo)入設(shè)置中高級紋理類型使用Non Power of 2(非二次方)選項設(shè)置縮放。Unity將按需縮放紋理,并在游戲中,它們的行為就像其他紋理一樣,因此他們?nèi)匀豢梢员粔嚎s,加載非?。

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.

當(dāng)映射一個2D紋理到一個3D模型上,要設(shè)定循環(huán)模式(平鋪方式)。這就是三維建模程序中,被稱為UV貼圖。在Unity,可以使用Materials縮放移動紋理?s放法線和地形細(xì)節(jié)貼圖尤其有用。

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

多級紋理是逐步縮小圖像版本的一個列表,用來優(yōu)化實時3D引擎的性能。遠(yuǎn)離相機(jī)的物體使用較小的紋理版本。使用多級紋理,將多使用33%以上的內(nèi)存,但不使用它們將有巨大的的性能損失。應(yīng)該為游戲總是使用多級紋理,唯一例外的是,用于不會縮小的紋理(例如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.

法線貼圖用于法線貼圖著色器,使低多邊形模型看起來有更多的細(xì)節(jié)。Unity使用的法線貼圖作為RGB圖像編碼,還可以選擇從一個灰度高度圖來生成一個法線貼圖。

Detail Maps 細(xì)節(jié)貼圖

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.

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

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.

但繪制細(xì)節(jié)紋理,中性灰是不可見的,白色是主紋理兩倍亮,黑色是主紋理完全變黑。

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.

如果你想使用紋理用于反射貼圖(例如使用內(nèi)置的反射著色器),必須使用立方圖紋理。

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.

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


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

贊0 踩0

未知用戶

2005-2024 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號-1
2005-2024 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號

回頂部

1.復(fù)制文本發(fā)給您的QQ好友或群、微信等;好友點擊鏈接以后,轉(zhuǎn)發(fā)就成功了。 2.如朋友點擊您的鏈接,您需要需刷新一下才行;同一個好友僅能點擊一次。
購買VIP,觀看所有收費教程!