unity--Texture2D


1.FilterMode 过滤模式

Point Point filtering - texture pixels become blocky up close.
点过滤-纹理像素变成块状。
Bilinear Bilinear filtering - texture samples are averaged.
双线性过滤 -纹理采样平均。
Trilinear Trilinear filtering - texture samples are averaged and also blended between mipmap levels.
三线性过滤 - 纹理采样平均并且混合mipmap 级别之间。
texture.filterMode = FilterMode.Point;
2.纹理合并( 打包多个纹理到一个纹理图集。)
PackTextures参数 描述,换行请使用\\空格
textures Array of textures to pack into the atlas.
要打包到图集的纹理的数组。
padding Padding in pixels between the packed textures.
打包的纹理之间的像素间距。
maximumAtlasSize Maximum size of the resulting texture.
图集的最大大小。
makeNoLongerReadable Should the texture be marked as no longer readable?
纹理标记为不可读?
Rect[]类型,返回图集中包含UV坐标的每个纹理矩形的数组,如果打包失败则值为null。
Texture2D[] textures = Resources.LoadAll(_path);
Texture2D _atlas = new Texture2D(1, 1);
Rect[] rects = _atlas.PackTextures(textures, _padding, 2048);






你可能感兴趣的:(unity)