动画中的 PVR 压缩 - iphone sdk

发布于 2024-07-25 00:49:04 字数 145 浏览 3 评论 0原文

我正在制作一个 89 帧 png 序列的动画,通过在每 512 x 512 帧中放置两帧,该序列已被削减到一半。 但我遇到了主要的图像质量问题(有损),

有谁知道制作 89 帧动画的好方法,而不会损失质量或对处理器造成影响?

一切顺利。

im animating an 89 frame png sequence, that has been cut down to half by putting two frames per 512 x 512 frame. but im having major image qaulity issues (lossy)

does anyone know of a good way to animate an 89 frame animation, without losing quality or chugging the processor?

all the best.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

韶华倾负 2024-08-01 00:49:04

PVRTC 肯定会让你的图像看起来有损,但有一些方法可以解决这个问题。 使用纹理图集会有所帮助,因为 PVRTC 通常最容易弄乱图像的边缘,并导致透明度问题。 我还会尝试关闭您拥有的任何 mipmap 过滤器(最近的过滤器和线性过滤器,但特别是最近的过滤器,当与 PVRTC 结合使用时,可以使其看起来更加模糊) 并尝试打开线性纹理过滤器,这将混合所有内容,使损失不那么明显,并且事物看起来只是稍微模糊。 您还可以保存比绘制的图像更大的图像(即使用 PVRTC 压缩的 512x512 图像,但以 256x256 绘制它)。 2BPP PVRTC 将导致纹理占用的内存是 RGBA 4444 的 1/8,因此即使增加这样的大小(占用 4 倍的内存)也会节省 2 倍的内存。 然而,如果您只使用 4BPP,并且需要将图像大小调整为两倍,那么您也可以选择 RGBA 4444。

对于需要更详细的较大图像,PVRTC 通常不是一个很好的策略。 对于图标之类的东西,您可以看到显着的节省,特别是因为您可以将它们画得小得多。

Mipmap 的制作方式如下(不要这样做):
glGenerateMipmapOES(GL_TEXTURE_2D);

您可以像这样打开线性纹理过滤器:
<代码>
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

您绝对不想这样做:
<代码>
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);

PVRTC will definitely make your image look lossy, but there are ways to get around that. Using a texture atlas can help, because PVRTC typically messes up the edges of the image the most, as well as causing issues with transparency. I'd also try turning off any mipmap filter you have (both nearest and linear filters but especially nearest, when combined with PVRTC, can make it look significantly more blurry) and try turning on a linear texture filter, which will blend everything so that the loss is less apparent and things only look slightly blurry. You can also save your images larger than you draw them (i.e. have a 512x512 image that is compressed with PVRTC, but draw it at 256x256). 2BPP PVRTC will cause the texture to take up 1/8 as much memory as RGBA 4444, so even increasing the size like that (to take up 4x as much memory) will give you a savings of 2x. If you're just going with 4BPP, however, you might as well just go with RGBA 4444 if you need to resize your image by double.

For larger images that need to be more detailed, PVRTC is typically not a great strategy. For icons and the like, you can see significant savings, especially because you can get away with drawing them much smaller.

Mipmaps are made like this (don't do this):
glGenerateMipmapOES(GL_TEXTURE_2D);

And you can turn on a linear texture filter like this:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

You definitely don't want to do this, either:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);

暮倦 2024-08-01 00:49:04

我正在使用 cocos2d 做一个类似的项目。 如果您为每个纹理制作一张图像或尝试 RGBA 4444 格式,您的图像可能看起来更好。

但如果你确实使用 cocos2d,那就非常简单了。 一旦您下载了 cocos2d,就会有非常好的示例代码。

http://www.cocos2d-iphone.org/archives/61

I'm doing a similar project using cocos2d. Your images may look better if you do one image per texture or possibly try RGBA 4444 format.

But if you do use cocos2d, it's pretty straightforward. Once you've downloaded cocos2d, there's very good example code.

http://www.cocos2d-iphone.org/archives/61

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文