   Some OpenGL & HDR/FBO questions
  Hi,I have a new video-card so I'd liked to check out HDR and FBO. But of course, I've come into trouble. So here are a couple of questions.I'm using FBO to render stuff to an off-screen buffer. That works pretty fast, until I'm trying to make a snapshot. For effects like water I use 'glCopyTexSubImage2D' to capture the current screen content to a texture. I use the GL_RGB format for those textures and some of the snapshots have a Non Power Of Two size, so I use GL_TEXTURE_RECTANGLE for those.Normally taking snapshots works fast but if the FBO is enabled, my framerate drops down to to ~15 or something, way too low. What to change in order to fix this? Maybe its possible to use the texture-target where the FBO is rendering to itself? Its a little bit confusing, maybe I should write down the steps:1- enable FBO 'glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, buffer_Frame );'   render content to 'texture_LDR' with 'glFramebufferTexture2DEXT'2- Render the scene3- Disable FBO4- Render 'texture_LDR' to a screen filling HUD spriteNow between step 2 and 3 the entire scene is rendered. That includes transparent surfaces like water or windows that might require a snapshot texture for effects like refractions. Calling 'glCopyTexSubImage2D' was very slow. Is it possible to use 'texture_LDR' itself at that time? Or is it blocked because its the render target of the FBO?Another question. For the HDR effect, I'm rendering stuff to 2 textures in my case, a LDR portion and HDR portion. I saw a demo using 'glDrawBuffersARB' to render towards 2 textures simultaneously. The LDR portion had 'GL_COLOR_ATTACHMENT0_EXT' as attachment and the HDR portion 'GL_COLOR_ATTACHMENT1_EXT'. The GLSL shader seems to give output to both textures with code like: gl_FragData[0] = <LDR color>; gl_FragData[1] = <HDR color>;Now I'm wondering how this works. Does glDrawBuffer in this case cause 2 passes (scene gots rendered twice) or does it render the scene just once and let the shader generate output for 2 targets? If that's the case, I have another problem. Does someone know how to generate output for 2 targets with Cg shader language(I don't use GLSL)??This is all very new to me so excuse if I said some stupid things:)Greetings and thanks for taking the time to read this big post!Rick   
  For the MRT stuff, unless the driver does something odd then it will all be done in one pass, the colour output can be routed to (up to) 4 colour buffers in one pass on current hardware.As for your other problem, I'm not completely sure why you need to perform that copy, couldnt you just render the bits which need to be used later to different textures and then combine them all together in one final pass instead of trying todo things all in a single pass?   ;  Ok, one pass (I'm trying to understand these commands as they are new for me). But how to give output to one of those buffers in a Cg shader? GLSL uses 'gl_FameData[0..4] = ...', what about Cg?As for the snapshot problem, I sometimes need the current screen content on a texture. For example, when rendering refractive water, I want everything below its surface on a texture so I can use it in a shader. However, the OpenGL copy command is killing the framerate when executed when FBO is enabled for some reason. I could render water and windows outside the HDR part so that FBO is disabled again, but then the water surface doesn't get that blooming effect over it as its rendered after the HDR part. There might some other workarounds, but the easiest way would be finding a fast way to take a snapshot. Or even better, using the FBO output texture itself, if possible. The FBO output texture should contain the screen content as well, but I'm not sure I can access it if the FBO is still active... Confusing.Greetings,Rick   