Thursday, 15 August 2013

opengl - Pass stream hint to existing texture? -



opengl - Pass stream hint to existing texture? -

i have texture created part of code (with qt5's bindtexture, isn't relevant).

how can set opengl hint texture updated?

glbindtexture(gl_texture_2d, textures[0]); //tell opengl plan on streaming texture glbindtexture(gl_texture_2d, 0);

there no mechanism indicating texture updated repeatedly; related buffers (e.g., vbos, etc.) through usage parameter. however, there 2 possibilities:

attache texture framebuffer object , update way. that's efficient method you're asking. memory associated texture remains resident on gpu, , can update @ rendering speeds. try using pixel buffer object (commonly called pbo, , has opengl buffer type of gl_pixel_unpack_buffer) buffer qt writes generated texture into, , mark buffer gl_dynamic_draw. you'll still need phone call glteximage*d() buffer offset of pbo (i.e., zero) each update, approach may afford efficiency on blasting texels pipe straight through glteximage*d().

opengl textures

No comments:

Post a Comment