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

支持压缩纹理读取 #199

Open
xiaoiver opened this issue Jun 6, 2024 · 3 comments
Open

支持压缩纹理读取 #199

xiaoiver opened this issue Jun 6, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Jun 6, 2024

需要支持压缩纹理的载入,期望用法如下:

const texture = device.createTexture({
  format: Format.BC1, // 压缩格式
  width,
  height,
  usage: TextureUsage.RENDER_TARGET,
});
texture.setImageData([data]);

目前 WebGL Device 实现默认已经尝试开启扩展 WEBGL_compressed_texture_s3tcWEBGL_compressed_texture_s3tc_srgb

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Compressed_texture_formats
https://loaders.gl/docs/modules/textures/api-reference/compressed-texture-loader
https://toji.github.io/texture-tester/

@xiaoiver xiaoiver self-assigned this Jun 6, 2024
@xiaoiver xiaoiver added the enhancement New feature or request label Jun 6, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: Support compressed texture reading

@xiaoiver
Copy link
Contributor Author

xiaoiver commented Jun 7, 2024

另外,如果尝试为压缩纹理生成 mipmap 会报警告:

[.WebGL-0x11800c76500] GL_INVALID_OPERATION: Texture format does not support mipmap generation.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


In addition, if you try to generate a mipmap for a compressed texture, a warning will be reported:

[.WebGL-0x11800c76500] GL_INVALID_OPERATION: Texture format does not support mipmap generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants