   Render to Dynamic Texture
  Hello, I want to postprocess my view of a scene (for effects like blurring and whatever..), thus rendering to texture, edit that texture and display that in a screen-filling quad.bassically, the slow way, as i have it 'working';// render stuff as usualrdr();// copy image to texture (slow)glDisable  (GL_BLEND);glEnable  (GL_TEXTURE_2D);glBindTexture  (GL_TEXTURE_2D, screenshot );glCopyTexImage2D  (GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 1024, 1024, 1);// retrieve the texture data for editing (slow...)glGetTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, bdata);// edit the data  (slow, but necessary, of course)for (int i=1; i<1024*1024*4-1; i++)bdata = (bdata[i+1] + bdata[i-1]) / 2.0f;   (just as example)// recreate the edited texture for display (very slow....)glTexImage2D(GL_TEXTURE_2D, 0, 4, 1024, 1024, 0, GL_RGBA, GL_FLOAT, bdata);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);I know this is the slowest way, and have been reading bout pbuffers. but as usual, the extensions seem sooo ugly .... I this really the best way to go??and more importantly, would pBuffers still need to rebind the texture when edited ??or can you really edit the data of the texture directly (without retrieving first, and then recreating??)Any thoughts on getting this stuff to work as fast as possible would be greatly appreciated !regards
  No, FBOs are the way to go, just check http://www.opengl.org/wiki/index.php/GL_EXT_framebuffer_object   ;Quote:Original post by KincaidAny thoughts on getting this stuff to work as fast as possible would be greatly appreciated!For the fastest possible, you should use an FBO to render the scene into a texture, and then use one or more GLSL shaders to perform the effects while rendering the texture into the framebuffer.Reading back from the GPU into main memory is incredibly slow, and the CPU is mch slower at per-pixel operations than the GPU.   