使用纹理压缩后资源丢失(已找到原因,请引擎组处理)

报错日志:

08-21 21:04:46.852 1399 1418 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:04:47.047 1399 1418 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:04:47.048 1399 1418 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:04:47.049 1399 1418 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:04:49.360 1399 1418 E jswrapper: [ERROR] (C:/CocosCreator_2.1.2/resources/cocos2d-x/cocos/scripting/js-bindin
gs/jswrapper/v8/Object.cpp, 534): Invoking function (0xadea9730) failed!
08-21 21:04:49.516 1399 1418 E jswrapper: [ERROR] (C:/CocosCreator_2.1.2/resources/cocos2d-x/cocos/scripting/js-bindin
gs/manual/jsb_global.cpp, 930): File (res/raw-assets/ec/ec334acf-8285-4466-9f8b-abd9f570f8c5.pkm) doesn’t exist!
08-21 21:04:49.516 1399 1418 E jswrapper: [ERROR] Failed to invoke js_loadImage, location: C:/CocosCreator_2.1.2/resou
rces/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:957
08-21 21:05:25.131 1449 1466 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:05:25.149 1449 1466 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:05:25.149 1449 1466 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:05:25.150 1449 1466 E jswrapper: [ERROR] Failed to invoke require, location: C:/CocosCreator_2.1.2/resources/
cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:292
08-21 21:05:26.834 1449 1466 E jswrapper: [ERROR] (C:/CocosCreator_2.1.2/resources/cocos2d-x/cocos/scripting/js-bindin
gs/jswrapper/v8/Object.cpp, 534): Invoking function (0xb3a5a670) failed!
08-21 21:05:26.961 1449 1466 E jswrapper: [ERROR] (C:/CocosCreator_2.1.2/resources/cocos2d-x/cocos/scripting/js-bindin
gs/manual/jsb_global.cpp, 930): File (res/raw-assets/ec/ec334acf-8285-4466-9f8b-abd9f570f8c5.pkm) doesn’t exist!
08-21 21:05:26.961 1449 1466 E jswrapper: [ERROR] Failed to invoke js_loadImage, location: C:/CocosCreator_2.1.2/resou
rces/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:957


构建出来的资源确实没有:


工程目录下是有的:


构建日志中也没有打包这张图的记录:


meta文件如下:


求解,为啥纹理压缩之后,资源直接丢失了?

2赞
  • normal: Error: could not read 313628 bytes of pixel info. File: alpha.pgm

  • normal: Error: Could not open file tmp.ppm
    Error: Couldn’t read source file 工程路径\library\imports\ad\ad280dd7-4472-4889-bb5b-435fb2371f37.png for atlas creation.

  • normal: Error: Could not read all pixels. File: atlas.ppm
    Error: Could not read tmp.ppm file.


构建日志里面有挺多这种类型的报错。。。

我也遇到过这个问题2.1.1构建压缩纹理,缺失部分纹理
引擎成员 @Knox 想要个demo但我没整理出来,因为我这边的资源缺失表现很随机,图片量少了也不会复现……不知道你能整理出来不?

我这边缺失了很多,一个1.5G的包,使用纹理压缩之后只有500M左右

你确定纹理有用到?通常是自动剔除掉了。纹理压缩本来就会减小包体。

我的是确定的,不知道构建日志能不能记录下相关信息,demo确实不好整理出来

resources下面的,通过脚本加载的

提供了一个demo,在resources下面有28张图,不过这demo作用应该不带,随便新建一个工程,弄几张图就能重现;
这里主要提供一个python脚本,可以检测打印丢失的pkm文件:

demo上传不了…

上传到了百度网盘

猜测下原因:

  • 压缩过程中没有等一条压缩命名执行完,就开始执行下一条命令;
  • mali压缩工具,在每次压缩png时,都会产生临时文件 tmp.ppm;
  • 后执行的指令产生的临时文件,会覆盖先执行指令的临时文件,合图的时候会使用到tmp.ppm;
  • 导致先执行的命令找不到其tmp.ppm,合成pkm失败;

证据如下:

多条指令同时在运行:

生成的tmp.ppm

使用的之后会删除tmp.ppm

找不到其tmp.ppm


tmp.ppm 是RGBA压缩时,记录透明度的

1赞

@jare 压缩纹理丢失,原因找到了,麻烦处理下

@Knox

https://community.arm.com/developer/tools-software/graphics/f/discussions/4504/how-to-run-some-etcpack-exe-processes-at-the-same-time

arm 社区同样问题及其回复

感谢,我们会跟进这个问题

可以把执行压缩命令换成同步的,比如 python的 os.system;
另外就是希望加入一个默认的纹理压缩格式,我们有2500张左右图片,一张张设置非常麻烦

现在纹理压缩格式都设置为etc,设置回去工作量很大,到时候修了又要设置成etc。。。。
什么时候能解决,希望给个答复吧,谢谢~

感谢反馈,2.1.3 正式版会修复这个问题

get~,感谢回复

有 pr 吗 2.1.2 可以修复吗