有没有什么工具可以将PVR纹理拆分为一组图块? [英] Is there any tool to split a PVR texture into a set of tiles?

查看:82
本文介绍了有没有什么工具可以将PVR纹理拆分为一组图块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大的png纹理4096x4096,需要将其的一部分加载到内存中.我已经将大png纹理分割为16个1024x1024瓦片,然后将它们转换为PVR压缩文件.

问题是当我绘制这些图块时,图块之间的边缘与png不同.因此,我认为如果有一种工具可以生成一个4096x4096 PVR纹理,然后将其拆分为16个1024x1024 PVR磁贴?

解决方案

通过PVR(这是一种更通用的纹理文件格式,支持多种纹理类型),我假设您是说PVRTC?

在传统意义上,PVRTC不是基于块的,例如,使用ETC或S3TC,纹理被分割为4x4像素块,并且每个块被分别压缩.相反,它尝试在像素的重叠邻域集之间共享数据.它还(假设)假定纹理可能是 拼贴,因此,例如,最左边缘区域实际上与最右手共享信息(并且类似地针对顶部和底部).除非边缘完全不同,否则这通常不是太大的问题.

因此,如果您尝试将已压缩的纹理细分为较小的区域,则它将无法正常工作,因为压缩器已对大图像中共享的内容进行了假设,而与小图像中的图像并不相同. /p>

对于分别压缩每个片段,听起来每个片段的边缘可能完全不同.我唯一能想到的就是将原始纹理切成(2 ^ N -4)x(2 ^ N -4)个单位,但将它们居中存储在2 ^ N * 2 ^ N个纹理中用原始像素的副本填充2像素边框.然后,将纹理映射设置为仅使用中心(2 ^ N -4)x(2 ^ N -4)区域.希望这样可以减少不连续性伪像.

I 've one big png texture 4096x4096 that I need to load parts of in the memory. I already split the big png texture into 16 1024x1024 tiles then converted them to PVR compressed files.

The problem is that when I draw these tiles, the edges between tiles are not the same as the png does. So, I think if there is a tool to generate one 4096x4096 PVR texture then splitting it into 16 1024x1024 PVR tiles??

解决方案

By PVR (which is a more general texture file format that supports several texture types) I assume you mean PVRTC?

PVRTC isn't block-based in the traditional sense where, say, with ETC or S3TC a texture is split into 4x4 pixel blocks and each block is compressed separately. Instead it attempts to share data between sets of overlapping neighbourhoods of pixels. It also (sort of) assumes that the texture probably tiles so, for example, the extreme left edge area actually shares information with the extreme right hand (and similarly for top and bottom). This is usually not too much of a problem unless the edges are completely different.

If you thus tried to subdivide an already compressed texture into smaller regions it's not going to work because the compressor has made assumptions about what was being shared in the big image, which won't be the same as the small one.

As for compressing each piece separately, it sounds like the edges of each separate piece might be quite different. The only thing I can think of is to chop your original texture into, say, (2^N -4)x (2^N -4) units but store them, centred, in 2^N * 2^N textures where you pad the 2 pixel border with a copy of the original pixels. You then set up your texture mapping to just use the centre (2^N -4)x (2^N -4) region. That, hopefully, should then reduce the discontinuity artefacts.

这篇关于有没有什么工具可以将PVR纹理拆分为一组图块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆