Hello, I'm quite new to SFML, and I'm trying to:
- Render OpenGL to a RenderTexture
- Copy the result to an image
- Apply CPU post-proc operation to the image
- Update back the result to the texture
I know this should be slow... But the results I get are quite surprisingly slow.
Here is actually the code I use:
sf::Clock fpsclock;
// GPU-CPU-GPU Ping-ponging test
sf::Image pingimg = geometryBuffer.getTexture().copyToImage();
// normally some CPU processing
sf::Texture pongtex = geometryBuffer.getTexture();
pongtex.update( pingimg );
double elapsed = fpsclock.getElapsedTime().asSeconds();
std::cout << "elapsed=" << elapsed << " - fps=" << 1.0 / elapsed << std::endl;
where geometryBuffer is my sf::RenderTexture
The results I get (in seconds):
elapsed=1.70021 - fps=0.588162
elapsed=1.69644 - fps=0.589468
elapsed=1.70246 - fps=0.587385
elapsed=1.70338 - fps=0.587069
Has anybody ever tried this kind of thing, and if so, what should be the most efficient way to do it ?
I mean, the rendertexture is 800x600 RGBA... It shouldn't take 2sec to update, should it ?
Thanks in advance