如何将五个 OpenGL 纹理合并为一个?

发布于 2024-08-19 07:52:55 字数 126 浏览 2 评论 0原文

我想在 OpenGL ES 1.x iPhone 中将 5 个“子图层”合并为一个纹理(您知道,类似于 Photoshop 中的“拼合图像”)。我是 OpenGL 新手,还没有找到答案。

I want to merge 5 "sublayers" to one single texture (you know, somethin' like Flatten Image in Photoshop) in OpenGL ES 1.x iPhone. I'm new to OpenGL, and just haven't find the answer yet.

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

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

发布评论

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

评论(2

梦太阳 2024-08-26 07:52:56

假设它们一开始就是图像,你不能将它们按顺序绘制到内存图像上

code< /a>

assuming they are images to begin with can't you just draw them sequentially onto an in memory image

code

旧故 2024-08-26 07:52:56

您不需要 GL 将纹理组合在一起。只需在 C 中对每个纹理像素进行数学计算即可。

现在,如果您想使用 GL,您将需要渲染纹理(您的最终结果)。

这是通过 OES_framebuffer_object 完成的。现在如何绘制该纹理完全取决于您。您可以绘制 5 个四边形,每个四边形都有一个纹理,然后使用混合来合并它们(您必须指定要应用的数学),您可以使用多重纹理以更少的通道完成工作(并使用纹理环境指定如何合并)。

您想要什么样的扁平化操作?

You don't need GL to combine textures together. Just do the math on each texel in C.

Now, if you want to use GL, you'll want to render to a texture (your final result).

This is done with OES_framebuffer_object. Now how you draw to that texture is completely up to you. You could draw 5 quads, each with a single texture, and use blending to merge them (you'll have to specify which math you want to apply though), you can use multi-texturing to do the work in less passes (and use Texture Environments to specify how to merge).

What kind of flattening operation do you want ?

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