OpenGL es,在生成和渲染 MIP 贴图时控制 VM 使用

发布于 2024-12-02 09:26:20 字数 259 浏览 2 评论 0原文

是否可以在 open gl es 1.x 中创建仅加载当前渲染的纹理分辨率的 MIP 贴图?

因此,不要一次加载从最大到最小的所有纹理分辨率,而是让 mipmap 仅存储当前正在渲染的纹理。然后让 gl 在放大和缩小时加载新的分辨率纹理。通过这种方式,我可以将许多大型纹理加载到表面上并缩小以立即查看所有纹理,而不会出现任何虚拟机预算问题。

如果 gl 没有办法做到这一点,是否可以重写 onDraw 函数来确定请求渲染什么级别的 mipmap,以便我可以手动加载新纹理?

Is it possible to create a MIP map in open gl es 1.x that only loads the texture resolution it is currently rendering?

So instead of loading all the textures resolutions from the largest to the smallest at once, have the mipmap only store the one it is currently rendering. Then have the gl load the new resolution textures as I zoom in and out. This way I could load many large textures onto a surface and zoom out to view them all at once without having any VM budget issues.

If gl doesn't have a way to do this, is it possible to override the onDraw function to determine what level of the mipmap is being requested to be rendered so I can manually load a new texture?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一萌ing 2024-12-09 09:26:20

据我所知,没有这方面的功能。当您定义纹理对象具有 MipMap 时,您必须填充所有它们。如果您不这样做,那么这将被视为错误并导致未定义的行为 - 通常在使用该纹理时您会得到黑色渲染。

即使你能做到,你也不会真的想做;上传纹理数据可能是一个缓慢的过程,尤其是在移动平台上,因此性能会受到很大影响。最后,MipMap 通常使用线性插值,在上传的纹理数据的不同可用分辨率之间进行混合 - 至少需要两种尺寸。

As far as I am aware, there is no functionality for that. When you define that a texture object has MipMaps then you have to fill all of them. If you dont then that counts as an error and undefined behaviour as a result - usually you get a black rendering when using that texture.

Even if you could do it, you wouldn't really want to; uploading data for texturing can be a slow process especially on mobile platform, so performance would suffer a lot. Finally MipMaps usually work with linear interpolation, blending between the different available resolutions of the texture data uploaded - at least two sizes would be required.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文