字幕列表 影片播放 列印所有字幕 列印翻譯字幕 列印英文字幕 Textures. 本章介紹貼圖 A texture is an image file. 貼圖是一張圖檔格式 Unity uses textures in a number of different ways. Unity裡有很多不同的貼圖方法 The most common use of a texture is when 而最常見的方法 就是貼上有基本貼圖的材質 applied to a material in the base 要了解更多關於材質的資料 請參考相關教學 texture property to give a mesh a 貼圖可以用來製作圖形介面(GUI) textured surface. 或是做為法線貼圖(Normal map) 高光貼圖(Specular map)或高度圖(Height map) For more information on materials 用來自訂滑鼠、圖示、啟動動畫或類似功能 see the appropriate lesson. 貼圖可以是任何Unity支援的圖檔格式 Textures can also be used for 可以用數位相機拍的照片 GUI elements applied to additional 但通常貼圖大多是用Photoshop或Gimp 等影像處理軟體製作的圖檔 material properties to act as normal 要注意的是,如果圖檔有圖層在資源裡會合併 但原始圖檔的圖層是還在的 maps, specular maps or height maps. 這表示你可以切換圖層並存檔 合併貼圖會直接反映在場景裡 Used as custom cursors, icons, 但是當我們執行遊戲時 就無法改動貼圖圖層 splash screens and more. 大多數Unity支援的圖檔格式 除了JPEG以外都支援透明度 Textures can be any image file 更多關於透明度的資訊及用法 請參閱官方材質與著色文件 supported by Unity. 貼圖檔案應該存放在Assets目錄下 These can be photos straight from a Unity會以特定的順序 在Assets目錄底下搜尋材質 digital source, but textures are usually 更多關於尋找貼圖的資訊 請參閱網格匯入的章節 images created or manipulated in an image 貼圖在檢視會有匯入設定屬性 editor, like Photoshop or Gimp. Texture Type是根據圖檔用途 先規劃好的一個類別選單 It is important to note that the layered 預設值是貼圖(Texture) files will be flattened on import 進階選單會展開所有的屬性選項 but the layers are maintained in 這些進階選項的內容會在其他章節介紹 Unity in the original file. 如果我們需要設定透明度 或是表示Alpha通道的灰階圖案 This means we can turn layers on and off 我們可以把Alpha From Greyscale打勾 without loss when we're setting up our game 黑色就會完全透明 白色就完全不透明 but when we're running our game we will not Wrap Mode控制磁磚貼圖的方式(Tiling >1) have access to these layers individually. 這個模式通用於2D元素和3D網格 Most of the image file formats used by 重複(Repeat)會像磁磚一樣重複貼圖 固定(Clamp)則會延伸邊緣展延貼圖 Unity support transparency. 過濾模式(Filter Mode)控制當貼圖 在三維空間被拉伸變形時著色的方法 The notable exception is JPEG, 這些都是影響品質的設定 which does not. 三線(Trilinear)最好,點(point)則是最基本的 For more information on transparency 各向異性等級(Aniso Level) 控制當貼圖角度很極端時的品質 and how to use it, see the documentation on 各向異性過濾器(Anisotropic Filtering) 提升掠射角(Grazing angle)的貼圖品質 materials and shaders. 開啟時會增加著色效能的負擔 Texture files should be saved in the assets folder. 在品質設定,各向異性過濾 可以對全部材質強制開啟或關閉 Unity searches the assets folder 更多關於品質的設定 請參閱相關章節 in a specific order when seeking materials. 由於Unity支援多平台發佈 For more information on searching for textures 貼圖屬性有一個預設最大貼圖 and seeking materials see the lesson 以及其他平台的預設大小和壓縮方式 on mesh importing. Max Size用來設定最大的貼圖大小 A texture file should be assigned import 如果數值設的比匯入的圖檔還要大 會以原始圖檔為準 settings in the texture importer. 這個設定不會讓貼圖超過原始圖檔 Texture Type property contains a 如果數值設的比匯入的圖檔還要小 那麼圖檔會被縮小 list of presets. 和圖層一樣,原始的圖檔並沒有改變 只有資源裡的圖檔被調整了 These limit the number of editable properties 格式(Format)用來設定壓縮技術 available in the texture importer 使用貼圖預設值會比較簡單 based on the intended use for the image. 這些設定其實就是代表低、中、高品質 The default is Texture. 可以在不同平台設定不同的進階設定 Advanced will expose all of the available 每個平台可以獨立設定並蓋過預設的設定 properties in the texture importer. 像是不同平台的貼圖大小和壓縮比都可調整 The other presets, including advanced, 這代表我們可以針對不同的平台 調整符合平台效能和品質的設定 will be covered in another lesson. 當專案切換發佈平台時 資源Asset會按照新平台設定重新匯入一次 If we need to set the transparency 這個設定和Build Setting裡的一樣 or alpha channel for the texture automatically 更多關於組建設定的內容請參閱相關章節 based on the light and dark parts of the image 在材質屬性的最下面有個預覽視窗 we can check the Alpha From Greyscale field. 當預覽視窗開啟時 我們可以預覽貼圖 Black will be completely transparent, 修改過的貼圖要Apply之後 才能看到預覽更新 white will be completely opaque. 預覽視窗會顯示貼圖大小 壓縮設定和貼圖的標籤 Wrap Mode controls how the texture is mapped on to a renderer when tiled. This setting works for both 2D elements and 3D meshes. Repeat will repeat the texture and and Clamp will stretch the edges of the texture. Filter Mode controls how the graphics card renders the texture, when it is stretched by 3D transformations. These are effectively quality settings, trilinear being the best and point being the most basic. Aniso level controls the quality of textures when rendered at steep angles. Anisotropic Filtering increases the texture quality when viewed at a grazing angle. This has an increased rendering cost when applied. In quality settings, Anisotropic filtering can be forced on for all textures or disabled completely. For more information on quality settings see the appropriate lesson. Because Unity supports building to multiple target platforms from one project the texture importer allows for a default setting for max texture size and compression format that can be overridden on a per platform basis. Max Size will set the maximum size for for the imported texture. If max size is set to a value larger than that of the original image the size of the imported texture will be that of the original. This setting will not make the texture larger than the original image. If max size is set to a value less than the original image the texture will be resized to that value on import. Like layers, however, the original file is unchanged. Only the imported asset will be adjusted. Format sets the compression technique. The default settings are relatively simple when using the Texture preset. These are effectively quality settings of low, medium and high. More control can be set on a per platform basis, or when using the Advanced setting. Each target platform can have it's own settings that override the default values. Max size and compression can be adjusted for each target platform. This means we can set the target sizes and compression appropriate for the bandwidth and processing power of the target platform. When the build target is changed these assets will be reimported using the overridden values. This section works in conjunction with Build Settings. For more information on Build Settings please see the appropriate lesson. At the bottom of the importer is a preview window. When the preview window is open we can view the changes we have made. We will need to apply our settings before the preview window will update it's display. The preview window will display the image being imported and report basic information about the imported texture, including the size of the imported texture, the compression setting and the footprint of the texture in our game.
B2 中高級 中文 英國腔 貼圖 設定 平台 材質 品質 章節 紋理 - Unity官方教程 (Textures - Unity Official Tutorials) 73 5 朱瑛 發佈於 2021 年 01 月 14 日 更多分享 分享 收藏 回報 影片單字