本文主要是介绍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? 纹理标记为不可读? |
Texture2D[] textures = Resources.LoadAll<Texture2D>(_path);
Texture2D _atlas = new Texture2D(1, 1);
Rect[] rects = _atlas.PackTextures(textures, _padding, 2048);
这篇关于unity--Texture2D的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!