Options for the compressed texture formats that are available on the target build platform.See Also: PlayerSettings.Android.textureCompressionFormats. 変数 Unknown Use an undefined texture compression format. ETC Use ETC1 texture compression (or ETC2 for textures with alpha). ETC2 Use ETC2 texture...
在“Default”选项卡下,找到“Compression”设置,选择您需要的压缩格式,例如“ETC2”。 AdjustMax Size和Format以确保纹理大小和质量在合理范围内。 下方的代码示例演示如何在脚本中以编程方式设置纹理压缩格式: usingUnityEngine;publicclassTextureCompressor:MonoBehaviour{// 选择纹理publicTexture2DinputTexture;voidStart(...
The texture compression format which the texture will be compressed with. You should try stick to a specific format across your entire project to ensure you don’t run into compatibility issues. On Android when a compression format isn’t natively supported it’ll switch to software decompression ...
usingUnityEngine;publicclassTextureCompressor:MonoBehaviour{publicTexture2Dtexture;voidStart(){// 设置纹理的压缩格式为ETC2texture=newTexture2D(1024,1024,TextureFormat.ETC2_RGBA4,false);// 加载图片varimgData=LoadImageData();texture.LoadImage(imgData);// 应用压缩texture.Apply();}byte[]LoadImageData(){...
8 bits per pixel (64KB for a 256x256 Texture). This is the default Texture compression format for Android projects. Note: ETC2 is part of OpenGL ES 3.0. It does not support alpha. On Android platforms that don’t support ETC2, the Texture are uncompressed at runtime to RGBA 32 bit....
细心的你应该发现了,当Texture Type 选择 Sprite(2D and UI) 时,下面会有行类似下面这样的警告: Android: Only textures with wideth/height being multiple of 4 can be compressed to DXT1 format 只有宽度/高度为4倍的纹理才可以压缩为DXT1格式
maxTextureSize = int.Parse(data["maxSize"]); iOSSettings.overridden = true; iOSSettings.format = format; iOSSettings.compressionQuality = int.Parse(data["quality"]); iOSSettings.maxTextureSize = int.Parse(data["maxSize"]); importer.SetPlatformTextureSettings(androidSettings); importer.Set...
Texture Type 使用Texture Type属性可选择要从源图像文件创建的纹理类型。Texture Import Settings 窗口中的其他属性将根据此处设置的值而变化。 有关特定纹理类型的信息,请参阅纹理类型 (Texture Types)文档。 属性:功能: Default这是用于所有纹理的最常用设置。此选项可用于访问大多数纹理导入属性。有关更多信息,请参...
newTextureImporterPlatformSettings();// Specify Android = "Android", PC = "Standalonesettings.name="iPhone";settings.overridden=true;settings.textureCompression=TextureImporterCompression.Compressed;// Specify compression formatsettings.format=TextureImporterFormat.ASTC_6x6;importer.SetPlatformTextureSettings(...
正确的在Unity 中设置压缩贴图,如图1-1所示 。Compression 选择压缩格式 ,Use Crunch Compression 表示 是否开启二次 Crunch 压缩 ,开启 它会自动对Android 和IOS平台 自动选择压缩格式。 图1 - 1 如图1-2,Android 平台被自动选择RGBA Crunched ETC2压缩格式 , 因为这张图是带透明通道的,如果没有透明通道 Unity...