开发者

How to collapse five OpenGL textures into one?

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开发者_JAVA技巧, and just haven't find the answer yet.


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

code


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 ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜