天天看点

sprite的大小 unity_Unity中的Sprite纹理压缩(Sprite texture compression in Unity)

Unity中的Sprite纹理压缩(Sprite texture compression in Unity)

我希望稍微压缩一下我的png sprite textures这样它们就不会占用我为移动设备构建的那么多内存。 因为我使用了很多gif动画,这对我的游戏性能至关重要。 我寻找答案,但我找到的线程超过1岁,而不是sprites所以我想我问我的版本。 Unity中大小为224 KB的图像占用1.6 MB, 关闭 generate mip maps所以在我的游戏中压缩png sprite textures 。 怎么做?

I wish to compress my png sprite textures a bit so they don't take up that much memory as I build for mobile devices. As I use a lot of gif animations this is crucial for my game's performance. I looked for an answer but the threads I found were more than 1 year old and not about sprites so I figured I ask my version. An image that's 224 KB in size takes up 1.6 MB in Unity with the generate mip maps turned off So compressing the png sprite textures in my game. How to do that?

原文:https://stackoverflow.com/questions/41270144

2020-02-13 23:14

满意答案

尝试将Format设置为Automatic Compressed 。

为了在所有移动平台上工作,请确保初始图像的大小为2的幂(实际上我认为4的倍数应该足够,但只是为了安全起见)。

这会降低图像质量,但应节省一些空间。

关闭mip贴图也是一个好主意,因为mim贴图将图像的大小增加了大约33%。

还有一件事,确保将Non Power of 2设置为None ,这可能是您目前看到尺寸增大的原因。

Try setting Format to Automatic Compressed.

For this to work on all mobile platforms make sure the initial image has sizes that are power of 2 (actually I think that multiple of 4 should be enough, but just to be on the safe side).

This will lower the quality of the image but should save you some space.

Turning mip map off is again a good idea as mim map increase the size of the image by about 33%.

And one more thing, make sure that Non Power of 2 is set to None, that may be the reason you see an increase in size at the moment.

2016-12-22

相关问答

你不能隐式地将类型Sprite转换为UnityEngine.Sprite,所以尝试明确地转换它来说明它 greenSprite = Resources.Load ("SpritesFolderName/" + "mySpritename", typeof(Sprite)) as Sprite;

You cannot implicitly convert type Sprite to UnityEngine.Sprite , so try converting it explicitly stat...

在UV解开你的模型后,你将uv保存在一个文件中,你应该将该文件作为一个纹理应用于你的模型,你将会完成,告诉我你是否已经这样做了。 这是有用的教程。 after you UV unwrapped your model you save the uv in a file in blender you should apply that file as a texture to your model in unity and you will be done,tell me if you have al...

精灵文件本身位于“资产/资源”文件夹中。 那就是问题所在。 该文件夹必须命名为Resources not Resourses 。 它也不是资源 。 它必须命名为Resources 。 修复文件夹名称后,可以使用下面的代码段来阅读Sprite 。 Sprite sprite = Resources.Load("1", typeof(Sprite)) as Sprite;

如果精灵设置为多模式,那么使用它; Sprite[] sprite = Resources.LoadAll("1...

将值Offset时出现逻辑问题。 说明如下: void Update () {

// Assume that Offset's value is { 2, 3 }

Offset = new Vector2 (0, Time.deltaTime * speed);

// Assume Time.DeltaTime's value is 0.12f

// Assume speed's value is 10

// Now to figure out the pr...

您可以通过选择它(或一堆它们)并在检查器中设置它来设置纹理压缩。 此外,您应该在项目质量设置下检查Android质量不会将质量纹理降低到一半或四分之一,这可能是导致您麻烦的原因。 You can set the texture compression by selecting it (or a bunch of them) and setting it in the inspector. Also, you should check under the Project Quality settin...

尝试将Format设置为Automatic Compressed 。 为了在所有移动平台上工作,请确保初始图像的大小为2的幂(实际上我认为4的倍数应该足够,但只是为了安全起见)。 这会降低图像质量,但应节省一些空间。 关闭mip贴图也是一个好主意,因为mim贴图将图像的大小增加了大约33%。 还有一件事,确保将Non Power of 2设置为None ,这可能是您目前看到尺寸增大的原因。 Try setting Format to Automatic Compressed. For this t...

您是在谈论压缩图像格式(如JPEG或甚至是包含图像的zip文件)还是压缩纹理格式(如DXT1等)? 当您拥有压缩纹理(例如DXT)时,您不必在运行时对其进行解压缩,因此图形卡可以在对纹理进行采样时动态执行。 对于可以提前预编译所有资产的游戏,在(资产)构建时应用类似DXT压缩的东西通常是一个好主意,这样你就可以获得纹理压缩的所有好处(更快的加载时间,更少的内存带宽使用,等)没有在运行时实际执行压缩的成本。 也就是说,在你想要用压缩纹理渲染的任何情况下,但你无法访问你将提前使用的图像(也许你让用户从...

这不会造成任何问题,是正确的做事方式。 如果你想真正明确它,你可以将线改为Cull Back而不是将其注释掉,但是背面剔除被定义为默认行为,所以只需删除就可以了。 That won't cause any problems and is the correct way of doing things. If you want to be really explicit about it you could change the line to Cull Back instead of commen...

这不是Unity,而是压缩格式。 ETC2可以压缩NPOT纹理,但是例如ETC1或PVRTC不能。 使用ETC2的NPOT纹理可以压缩(512x400px,100kb): 使用ETC1的NPOT纹理无法压缩(512x400px,600kb): 如果要使用带有NPOT纹理的ETC1或PVRTC压缩,可以选择“非幂2”选项(默认为“无”,但可以是: “最接近” , “更大”或 “更小” 。 NPOT纹理使用PVRTC和Unity'Non power of 2:ToLarger'选项,(512x512p...

而不是试图在运行时找到它,只需将它链接在预制/游戏对象中。 在检查器中公开它然后将精灵拖动到暴露的变量非常简单。 您可以执行精灵或变换,在下面的示例中我使用了变换,但是如果您需要从中获取更多数据,那么继续前进并使用精灵。 public Transform Head;

public Transform Hand;

public Transform Chest;

然后你可以获得Head.position的位置 如果您要检查碰撞,请考虑在每个位置放置一个碰撞器,然后您可以根据需要打开/关闭它们(因此除...

相关文章

Here are something that need to take care of when y

...

1.安装 Hadoop-gpl-compression 1.1 wget http://hadoop-

...

Hadoop中常见的压缩格式及特性如下: 压缩格式 工具 算法 文件扩展名 多文件 可分割性 DEF

...

自从Hadoop集群搭建以来,我们一直使用的是Gzip进行压缩 当时,我对gzip压缩过的文件和原始的

...

原地址:http://blog.csdn.net/alking_sun/article/details

...

在Hadoop中使用lzo的压缩算法可以减小数据 的大小和数据的磁盘读写时间,不仅如此,lzo是基于b

...

该教程系 Lynda.com 人像修饰教程。原作者 CHRIS ORWIG ,由曾庆林翻译成中文。教程

...

终于把你必须知道的.NET看完了,第二步就是把精通ASP.NET MVC3框架这本书搞定,练习MVC3

...

Hadoop集群中启用了lzo后,还需要一些配置,才能使集群能够对单个的lzo文件进行并行的map操作

...

Hadoop 可以在作业的Configuration对象中通过设定一系列参数来改变作业的行为,比如,我

...

最新问答

如果启用了复制处理程序,请确保将其置于其中一个安全角色之后。 我见过人们做的另一件事是在不同的端口上运行admin。 最好在需要auth的页面上使用SSL,这样你就不会发送明确的密码,因此管理和复制将发生在8443上,而常规查询将在8080上发生。 如果您要签署自己的证书,请查看此有用的SO页面: 如何在特定连接上使用不同的证书? I didn't know that /admin was the context for SOLR admin because /admin does not re

第一:在您的样本中,您有: 但是你在询问 //td[@class=‘CarMiniProfile-TableHeader’] (注意TableHeader中的大写'T')。 xpath区分大小写。 第二:通过查询// td [@ class ='CarMiniProfile-TableHeader'] / td,你暗示你在外部td中有一个'td'元素,而它们是兄弟姐妹。 有很多方法可以在这里获得制作和模型

这是你的答案: http://jsfiddle.net/gPsdk/40/ .preloader-container { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; background: #FFFFFF; z-index: 5; opacity: 1; -webkit-transition: all 500ms ease-out;

问题是,在启用Outlook库引用的情况下, olMailItem是一个保留常量,我认为当您将Dim olMailItem as Outlook.MailItem ,这不是问题,但是尝试设置变量会导致问题。 以下是完整的解释: 您已将olMailItem声明为对象变量。 在赋值语句的右侧,在将其值设置为对象的实例之前,您将引用此Object 。 这基本上是一个递归错误,因为你有对象试图自己分配自己。 还有另一个潜在的错误,如果之前已经分配了olMailItem ,这个语句会引发另一个错误(可能是

我建议使用wireshark http://www.wireshark.org/通过记录(“捕获”)设备可以看到的网络流量副本来“监听”网络上发生的对话。 当您开始捕获时,数据量似乎过大,但如果您能够发现任何看起来像您的SOAP消息的片段(应该很容易发现),那么您可以通过右键单击并选择来快速过滤到该对话'关注TCP Stream'。 然后,您可以在弹出窗口中查看您编写的SOAP服务与Silverlight客户端之间的整个对话。 如果一切正常,请关闭弹出窗口。 作为一个额外的好处,wireshar

Android默认情况下不提供TextView的合理结果。 您可以使用以下库并实现适当的aligntment。 https://github.com/navabi/JustifiedTextView Android Does not provide Justified aligntment of TextView By default. You can use following library and achieve proper aligntment. https://github.com/

你的代码适合我: class apples { public static void main(String args[]) { System.out.println("Hello World!"); } } 我将它下载到c:\ temp \ apples.java。 以下是我编译和运行的方式: C:\temp>javac -cp . apples.java C:\temp>dir apples Volume in drive C is HP_PAV

12个十六进制数字(带前导0x)表示48位。 那是256 TB的虚拟地址空间。 在AMD64上阅读wiki(我假设你在上面,对吗?)架构http://en.wikipedia.org/wiki/X86-64 12 hex digits (with leading 0x) mean 48 bits. That is 256 TB of virtual address space. Read wiki on AMD64 (I assume that you are on it, right?) ar

这将取决于你想要的。 对象有两种属性:类属性和实例属性。 类属性 类属性对于类的每个实例都是相同的对象。 class MyClass: class_attribute = [] 这里已经为类定义了MyClass.class_attribute ,您可以使用它。 如果您创建MyClass实例,则每个实例都可以访问相同的class_attribute 。 实例属性 instance属性仅在创建实例时可用,并且对于类的每个实例都是唯一的。 您只能在实例上使用它们。 在方法__init__中定