unity--Texture2D


1.FilterMode 过滤模式

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






阅读更多
想对作者说点什么?