ios - OpenGL - Pass on the output of multiple programs to a new texture -
how pass on data drawn frame buffer new opengl program or texture?
use case of doing now:
- creating texture uiimage
- passing on
uniform sampler2d
bindinggl_texture_2d
, processing it - switch program , render example vignette on top of image
- switch program , render various graphics on top of that
this works fine. problem here process of above using additional opengl shaders. example brightness/contrast filter. not image of added graphics , vignette. once has been added, i'd pass additional optional programs , on.
but how done? know can read texture cache or using glreadpixels() , create new texture pass on surely there better , more efficient way? 1 uses gpu memory entirely?
what want render directly texture instead of display framebuffer. in turn framebuffer objects (fbos) for. fbo represents complete framebuffer sub-buffers (like multiple color buffers, depth buffer, stencil buffer, or subset of those), functionality attach custom data containers (like renderbuffers or textures) individual buffers , render directly gpu memory region controlled you. tutorial on see here or here more "official" , complete information (though latter might discuss features of modern desktop gl versions not present in es), or here , here more es related information (which shouldn't different desktop gl, though)
Comments
Post a Comment