首页 技术 正文
技术 2022年11月15日
0 收藏 394 点赞 3,446 浏览 2172 个字

Unity 开发的模型贴图都是.ktx格式的,提取出来的资源,其中的ktx资源,用PVRTexToolGUI.exe可以打开查看,可以发现都是上下颠倒,且被拉伸

直接转为png格式的批处理脚本为:

@echo off

path %path%;”D:\Imagination\PowerVR\GraphicsSDK\PVRTexTool\CLI\Windows_x86_32″

for /f “usebackq tokens=*” %%d in (`dir /s /b *.ktx`) do (

PVRTexToolCLI.exe -f PVRTC1_4 -i “%%d” -d “%%~dpnd.png”

del “%%~dpnd.pvr”

)

PVRTexTool也支持翻转参数flip,但是在这里,我测试无效,只能使用另一个工具ImageMagick来进行上下翻转,批处理脚本为:

@echo off

path %path%;”D:\Imagination\PowerVR\GraphicsSDK\PVRTexTool\CLI\Windows_x86_32″

for /f “usebackq tokens=*” %%d in (`dir /s /b *.ktx`) do (

PVRTexToolCLI.exe -f PVRTC1_4 -i “%%d” -d “%%~dpnd.png”

del “%%~dpnd.pvr”

“D:\Program Files\ImageMagick-6.8.5-5\convert.exe” -flip “%%~dpnd.png” “%%~dpnd.png”

)

然后记事本新建一个文本输入以下:

@echo off

path%path%;”D:\Imagination\PowerVR\GraphicsSDK\PVRTexTool\CLI\Windows_x86_32″

for /f “usebackq tokens=*” %%d in(`dir F:\lushi\Data\cardtextures1\CAB-cardtextures1\Texture2D /s /b *.ktx`) do(

PVRTexToolCLI.exe -f PVRTC1_4 -i”%%d” -d “%%~dpnd.png”

del %%~dpnd.pvr

)

解释下:

D:\Imagination\PowerVR\GraphicsSDK\PVRTexTool\CLI\Windows_x86_32″

这个是我PVRTexTool文件夹下的Windows_x86_32程序路径,按你自己PowerVR Tools文件夹找到windows_x86_32即可;

F:\lushi\Data\cardtextures1\CAB-cardtextures1\Texture2D/s /b *.ktx

这个是你想转化的ktx文件所在的路径

然后把文本格式从.txt 改为.bat;然后双击,就开始执行批处理了;

转化过程有点慢,慢慢等着。。。转化后的.png图片就在.ktx的同级文件夹下;

其他:从Data文件夹下;

Managed 这个文件里边是代码

Assembly-CSharp.dll是工程里边用到的脚本;用reflector能反编译;

从Managed文件夹中还能看出一些东西,比如

protobuf-net.dll说明游戏用的数据传输格式是protobuf

Assembly-CSharp-firstpass.dll 里边有个itween,说明用到了itween插件等;

配置好环境变量

右键点击我的电脑>属性>高级>环境变量,双击Path变量在最后的位置添加字段:F:\PowerVR\GraphicsSDK\PVRTexTool\GUI\Windows_x86_32;

把KTX批量转成PNG。。。 BlueEffie

终于实现了批量转换,要先把ktx转换成pvr,然后在转换成png @echo off path %path%;”D:\Program Files (x86)\TexturePacker\bin” path %path%;”D:\Program Files (x86)\PVRTexTool\CLI\”

for /f “usebackq tokens=*” %%d in (dir /s /b *.ktx) do ( PVRTexToolCLI.exe -f PVRTC1_4_RGB -i “%%d” -o “%%~dpnd.pvr” TexturePacker.exe –opt RGBA8888 –sheet “%%~dpnd.png” “%%~dpnd.pvr” del %%~dpnd.pvr )

解释下:

D:\Imagination\PowerVR\GraphicsSDK\PVRTexTool\CLI\Windows_x86_32″

这个是我PVRTexTool文件夹下的Windows_x86_32程序路径,按你自己PowerVR Tools文件夹找到windows_x86_32即可;

F:\lushi\Data\cardtextures1\CAB-cardtextures1\Texture2D/s /b *.ktx

这个是你想转化的ktx文件所在的路径

然后把文本格式从.txt 改为.bat;然后双击,就开始执行批处理了;

转化过程有点慢,慢慢等着。。。转化后的.png图片就在.ktx的同级文件夹下

转自:http://www.downcc.com/soft/24810.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,942
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,466
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,281
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,095
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,728
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,765