u3d中texture2D的Advanced设置解析
?
經常進行Texture2D的信息設置,以下記錄每個屬性的意義:
參考手冊: ?file:///D:/Program%20Files%20(x86)/Unity4.7/Editor/Data/Documentation/html/en/Manual/class-TextureImporter.html
一:Non power of 2
| Non Power of 2 | If texture has non-power-of-two size, this will define a scaling behavior at import time. See the Details section at the end of the page. |
| ????????None | Texture size will be kept as-is. |
| ????????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. |
| ????????To larger | Texture will be scaled to the next larger power-of-two size at import time. For instance 257x511 texture will become 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. |
對texture進行2次冪的擴展。
二:Generate Cubemap?
| Generate Cube Map | Generates a cubemap from the texture using different generation methods. |
三:Read/Write Enabled?
| 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. This is only valid for uncompressed and DTX compressed textures, other types of compressed textures cannot be read from. Disabled by default. |
一般不勾選,注意:1.會新建拷貝增加內存, 2.只對指定的非壓縮和DTX壓縮格式有效
四:Alpha from grayscale
| Alpha from grayscale | (Default mode only) Generates the alpha channel from the luminance information in the image |
從texture的灰度圖中來設置Alpha值。。
http://blog.163.com/unity_fyc/blog/static/215288100201211270470165/
做視差貼圖時,可能會勾選
?
五:Alpha Is Transparency?
Alpha影響透明效果
?
六:ByPass sRGB Sampling?
忽略sRGB采樣效果(待更新)
1.伽馬校正是啥:
主要參考下面馮樂樂的博客,數據從輸入到顯示經過了兩次校正:data-->1--->pixelValue --->CRT顯示器-->2-->show
在 1 :場景的亮度值和pixelValue的關系(伽馬校正)
2:pixelValue和顯示亮度值的關系
通過1和2的處理,盡量保持還原場景的亮度值。
2.sRGB是啥:
sRGB算是一個標準的色彩空間吧。。就像世界坐標系一樣。。
項目中此選項都沒打勾,也就是說 由于一般texutre都是非線性的,所以進行了sRGB空間下的校正。。
參考:
?http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c4224610143ab5f076715607d8ce7c7a52ef0f07bbae616f615466e4c096c957dbbf9228258d22376459db0144dc49e48915648037902ba8ef4cb7adf043d2fd8d91810f0f9f&p=823bdf19ba9112a05abd9b7d0c179c&newp=9933d715d9c040ae12acdd2d021485231610db2151d7d6156b82c825d7331b001c3bbfb42323170fd4c37a6105a94f5aecf03677300927a3dda5c91d9fb4c57479c2667d&user=baidu&fm=sc&query=Bypass+sRGB+sampling&qid=8e1c7f91000039e8&p1=13
七:Sprite Mode
| Sprite mode | Selects how the the sprite graphic will be extracted from the image. |
| ????????Single | The sprite image will be used in isolation. |
| ????????Multiple | Multiple related sprites (eg, animation frames or separate sprite elements that belong to a single game character) will be kept together in the same image. |
圖片是否是一系列的,
八:Generate Mip Maps?
勾選會增大內存,生成小圖,
九: Wrap Mode
面片中texture坐標>1時texture的copy模式,就是以前的 copy啊 反響copy啊 ?讀取邊緣像素值啊。。
十:Filter Mode?
由于 texture的紋理數據和屏幕像素點大小不可能恰好匹配,需要設置紋素數據到像素點的映射方式。
linear mode 如果理解沒錯的話,應該是四個像素點的 x y權重比例。。
十一:Aniso Level?
反鋸齒。。
?
十二:ios ?PVRTC4格式:
| ???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) |
4bit一個像素點,RGBA 32bit的話,1/8 ?比如256x256的texture就是 ?0.5*256*256/1024 = 32KB
十三:android RGB ETC2格式:對支持es2的 進行壓縮 需要進行一張aphla通道圖的生成。 如果使用etc4 在只支持es2.0的android手機上 還是會拷貝申請新的內存進行解壓 ?然后讀取解壓后的
RGBA ETC4格式 ?針對支持es2以上的硬件
?
轉載于:https://www.cnblogs.com/sun-shadow/p/6181001.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的u3d中texture2D的Advanced设置解析的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 手机端实现点击复制功能
- 下一篇: struts2值栈内部数据结构详解