cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

Can not enable custom texture compression for windows and mac

Open adrianmdumitru opened this issue 1 year ago • 3 comments

Use Case

Reduce memory usage

Problem Description

There is no way to add custom texture compression and format for PC platforms in recent cocos versions.

I have implemented compressTextures in a asset-handlers.ts but it's only called back for ios and android. I have added a compression format in builder.json like this, still not working

          "pc": {
            "astc_8x8": {
              "quality": "medium"
            }
          }

Proposed Solution

Implementing compressTextures in an extension should be called back for every platform set in builder.json.

How it works

No response

Alternatives Considered

It would be possible to change it for all files by parsing the build folder, but it is too much. It must be done only for images configured with a compression preset.

Additional Information

No response

adrianmdumitru avatar Jun 17 '24 07:06 adrianmdumitru

@adrianmdumitru could you share us how you implement it on iOS and Android. I think they are similar to Windows and mac.

minggo avatar Jun 17 '24 07:06 minggo

@minggo @yanOO1497 for iOS and Android there is no need to use custom format, the builtin ASTC format is working well. I only need to implement custom format for PC as the editor UI does not allow setting presets.

adrianmdumitru avatar Jun 17 '24 07:06 adrianmdumitru

We would like the engine to support s3tc for Windows web builds since ASTC is not supported on that platform.

mikecoker avatar Jul 19 '24 21:07 mikecoker