How do I use Detail Textures? 如何使用紋理貼圖
A Detail texture is a small, fine pattern which is faded in as you approach a surface, for example wood grain, imperfections in stone, or earthly details on a terrain. They are explicitly used with the Diffuse Detail shader.
紋理貼圖可以讓您表達物體表面較細微的部份,例如:木紋、不規則石頭、或地表上的所有細節。都可以透過Diffuse Detail shader功能完成。
Detail textures must tile in all directions. Color values from 0-127 makes the object it's applied to darker, 128 doesn't change anything, and lighter colors make the object lighter. It's very important that the image is centered around 128 - otherwise the object it's applied to will get lighter or darker as you approach.
紋理貼圖將會平鋪在物體表面,顏色值在0~127的時候會讓物件變得比較暗,顏色值128將不會改變任何事,而比較亮的顏色相對也會讓物件更亮,所以讓顏色值盡量在128是很重要的事情,否則當你接近物件時會發現對象會變的特別亮或特別暗。
1. Draw or find a grayscale image of the detail texture. 繪製或找出一個灰階的紋理貼圖檔
The Detail Texture
假設紋理貼圖如上所示
The Levels 層次分析結果
2.Save the image next to your main texture. 儲存影像供下次使用
3. In Unity, select the image and under \"Generate Mip Mapso something like this in the Import Settings in the Inspector. 在Unity中,選擇一個影像檔,在材質檢視器中可以看到\"Generate Mip Maps\",勾選Fades Out並設定兩個slider值
4. The top slider determines how small the texture should before before beginning to fade out, and the bottom determines how far away it is before the detail texture completely disapear. 上面的(start)值用來設定紋理在多小的情況下進行Fades Out,下面的(End)值用來設定紋理在多遠的距離下仍保持紋理的效果
5. In the Material Inspector on the right, select Diffuse Detail from the Shader drop-down: 材質檢視工具右方,在Shader菜單選擇Diffuse Detail
6. Drag your texture from the Project View to the Detail texture slot. 拖曳你的貼圖檔由Project到Detail texture slot
7.Set the Tiling values to a high value 設定鋪設的比例
本篇結束
補充~因為一篇文章較短(應該算是簡介),所以放到紋理貼圖章節下方囉 How Do I Make a Cubemap Texture?如何製作方塊貼圖?
Cubemaps are used by the Reflective built-in shaders.
方塊貼圖會用在反射貼圖的幾種模式裡,詳見 Reflective built-in shaders. 章節
To build one, you either create six 2D textures and create a newCubemap asset, or build the Cubemap from a single square texture. Moredetails are in the Cubemap Texture documentation page.
要製作一個方塊貼圖,您需要製作六個2D貼圖並建立一個Cubemap資源,或是由一個方形貼圖建立一個Cubemap資源,此方面的資料可以參考Cubemap Texture章節
Static and dynamic cubemap reflections can also be rendered from scripts. Code example in Camera.RenderToCubemap page contains a simple wizard script for rendering cubemaps straight from the editor.
靜態和動態cubemap反射貼圖也可以透過scripts的方式呼叫使用。程式範例可參考Camera.RenderToCubemap 章節,裡面含有一個簡單的script,讓你可以直接的在editor中處理一個cubemap彩現。