【技术分享之三】cocos实现对ETC2的支持

没有的

mark

现在的androud老机子已经很少了, ,每年新机出货量1亿多,基本可以忽略老机器了

然而现在2.1了, 并没有支持图片压缩,也没有roadmap中的label优化,也没有针对native的优化,重点还是在宣扬3D,cocos又走偏了

2赞

嗯,我也这么觉得,可能他们觉得大一点的功能更有宣传效果吧。
然后版本一直处于不稳定,性能不够这样的路上。想想还真是很纠结。

主要模拟器玩家, 有一些市占率, 策划和运营都不想丢掉这堆玩家

真奇怪呗,我也出现了这错误 你那问题解决了么?是什么原因造成的?
GL error 0x501: GL_INVALID_VALUE

是不是creator 2.0.5的CCImage不一样了?还要改其他地方么?

ios 打包失败
{
gl.supports_OES_map_buffer: false
gl.supports_vertex_array_object: false
cocos2d.x.version: 1.10.3
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple A12 GPU
cocos2d.x.compiled_with_profiler: false
gl.version: OpenGL ES 3.0 Metal - 58.4
cocos2d.x.build_type: DEBUG
gl.max_texture_size: 16384
gl.supports_ETC1: false
gl.supports_BGRA8888: false
gl.max_texture_units: 32
gl.max_samples_allowed: 4
gl.supports_OES_packed_depth_stencil: false
gl.supports_NPOT: true
gl.supports_discard_framebuffer: false
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_OES_depth24: false
gl.supports_ETC2: true
}

Initializing JavaScriptCore
cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file.
2019-02-25 18:31:37.772208+0800 NewProject-mobile[9140:353538] cocos2d: surface size: 2688x1242
JS: Create unpacker 0c744dbae for 08CB05GulBq5e/HKiZcHHq
cocos2d: unsupported image format!
js_cocos2dx_extension_initTextureAsync: Failed to load image.
JS: [ERROR]: Error: Load image failed: res/raw-assets/6a/6abb87b6-e72e-49f0-98f1-fe43b42899b4.png
src/jsb_polyfill.js:23068:36
JS: [ERROR]: res/raw-assets/6a/6abb87b6-e72e-49f0-98f1-fe43b42899b4.png
JS: [ERROR]: res/import/6a/6abb87b6-e72e-49f0-98f1-fe43b42899b4.json
JS: LoadScene 08CB05GulBq5e/HKiZcHHq: 49.91300000000001ms
JS: [ERROR]: Failed to load scene: Error: [AssetLibrary] loading JSON or dependencies failed: undefined
gl.supports_ETC2: true已经为true 没改ES3.0之前是false 但是依旧全黑报错。。。检查过都按照你这个更改 了 我目前版本是1.10.3

这个报错啥情况

2019-02-25 19:20:29.468940+0800 hello_world-mobile[1279:411492] [DYMTLInitPlatform] platform initialization successful
2019-02-25 19:20:29.673448+0800 hello_world-mobile[1279:411372] info: CocosAnalytics ==> enableLoggin

{
gl.supports_OES_map_buffer: false
gl.supports_vertex_array_object: false
cocos2d.x.version: Cocos2d-x-lite v1.8.2
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple A8 GPU
cocos2d.x.compiled_with_profiler: false
gl.version: OpenGL ES 3.0 Apple A8 GPU - 130.1
cocos2d.x.build_type: DEBUG
gl.max_texture_size: 8192
gl.supports_ETC1: false
gl.supports_BGRA8888: false
gl.max_texture_units: 32
gl.max_samples_allowed: 4
gl.supports_ETC2: true
gl.supports_OES_packed_depth_stencil: false
gl.supports_NPOT: true
gl.supports_discard_framebuffer: false
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_OES_depth24: false
}

Initializing JavaScriptCore
cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file.
JS: Cocos2d-x-lite v1.8.2
2019-02-25 19:20:30.318485+0800 hello_world-mobile[1279:411372] cocos2d: surface size: 1136x640
JS: Create unpacker 0ff314e90 for 2dL3kvpAxJu6GJ7RdqJG5J
cocos2d: QuadCommand: resizing index size from [-1] to [2560]
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/singleColor.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball1.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball2.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball3.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball4.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball5.png
#####loadImage::asyncStruct->filename = /var/containers/Bundle/Application/2A6A0964-0DCE-4D65-8E60-2FCB014DB2D9/hello_world-mobile.app/res/raw-assets/Texture/ball6.png
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at: key not found

很棒棒

如果是半透明的图片,etc2格式和png图片表现不一样啊。etc2的变的颜色很浅。

MARK一记

马上两年过去了,不知情况如何

pvr文件格式的ETC2能不能支持一下呢大佬

J哥,ETC2的事2.1有实现了么, 刚好赶上这个问题, 来的早不如来得巧:kissing:

请问是直接在Xcode工程里面改对应的文件?还是改完引擎代码后,使用自定义引擎编译呢?

请问2.0.10如何实现对ES3呢,CCES2Renderer-ios.m 这个文件找不到了

话说现在支持了吗?

对纹理压缩这块不理解的,我觉得这篇文章适合你

各种移动GPU压缩纹理的使用方法