First of all:
Windows XP SP3, 2GB RAM, Intel core 2 Duo 2.33 GHz, nVidia 9600GT 1GB RAM. OpenGL 3.3 fully updated.
Short description of what I am doing:
Ideally I need to put ONE single pixel in a GL texture (A) using glTexSubImage2D every frame.
Then, modify the texture inside a shader-FBO-quadfacingcamera setup and replace the original image with the resulting FBO.
Of course, I don't want a FBO Feedback Loop, so instead I put the modified version inside a temporary texture and do the update separately with glCopyTexSubImage2D.
The sequence is now:
1) Put one pixel in a GL texture (A) using glTexSubImage2D every frame (with width=height=1).
2) This modified version A is to be used/modified inside a shader-FBO-quad setup to be rendered into a different texture (B).
3) The resulting texture B is to be overwritten over A using glCopyTexSubImage2D.
4) Repeat...
By repeating this loop I want to achieve a slow fading effect by multiplying the color values in the shader by 0.99 every frame.
2 things are badly wrong:
1) with a fading factor of 0.99 repeated every frame, the fading stops at RGB 48,48,48. Thus, leaving a trail of greyish pixels not fully faded out.
2) the program runs at 100 FPS. Very bad. Because if I comment out the glCopyTexSubImage2D the program goes at 1000 FPS!!
I achieve 1000 FPS also by commenting out just glTexSubImage2D and leaving alone glCopyTexSubImage2D. This fact to clarify that glTexSubImage2D and glCopyTexSubImage2D are NOT the bottleneck by themselves (I tried to replace glCopyTexSubImage2D with a secondary FBO to do the copying, same results).
Observation: the bottleneck shows when both those commands are working!
Hard mode: no PBOs pls.
Link with source and exe:
http://www.mediafire.com/?ymu4v042a1aaha3
(CodeBlocks and SDL used)
FPS counts are written into stdout.txt
I ask for a workaround for the 2 things exposed up there.
Expected results: full fade-out effect to plain black at 800-1000 FPS.