Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过渲染环境决定加载什么格式的压缩纹理 #1792

Open
wants to merge 1 commit into
base: Master3.0
Choose a base branch
from

Conversation

Geequlim
Copy link
Contributor

@Geequlim Geequlim commented Feb 17, 2025

  • 在 ITextureContext 接口中增加 supportedCompressedTextureFormats 标记,标记当前环境支持的压缩纹理格式。
    • 实现了 GLTextureContext,其他渲染环境我不熟悉就没动需要引擎组在合并时支持一下
  • 在 TextureLoader 加载器中通过 supportedCompressedTextureFormats 来选取支持的压缩纹理格式进行加载。

@lirong2f
Copy link
Member

引擎有LayaGL.renderEngine.getCapable(RenderCapable.XXX)来验证是否支持某个纹理压缩TextureLoader里面的相关代码我们考虑给您改一下来支持您的需求

@lirong2f
Copy link
Member

等textureLoader改完我们会给您贴修改记录

@Geequlim Geequlim force-pushed the patch-compress-texture-format-detect branch from c7aff34 to c134b6b Compare March 23, 2025 14:28
@Geequlim
Copy link
Contributor Author

@lirong2f 已经调整为使用 LayaGL.renderEngine.getCapable 来检测支持情况,PR 代码已经覆盖提交并rebase到最新节点,可以抽空 review 一下。

PR: 修改后的压缩纹理加载流程

  1. 读取 meta 中配置当前平台的纹理格式配置
  2. 如果没有配置过纹理格式信息,则使用 RGBA8 进行加载
  3. 如果配置了压缩纹理格式,则检查当前环境是否支持配置的压缩纹理格式
  4. 如果不支持,则在meta的files列表中继续找能够支持的压缩纹理文件
  5. 如果最终还是找不到,再使用默认的 RGBA8

优化压缩纹理加载流程
@Geequlim Geequlim force-pushed the patch-compress-texture-format-detect branch from c134b6b to a9c8de1 Compare March 29, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants