semos
12-31-2010, 06:12 AM
Hi, happy new year 2011!
I write OpenGL application (MS Windows, for now). I sometimes need to read data from frame buffer object (FBO - GL_BGRA, 32x32 pixels, every 200 ms.). But glMapBuffer blocks application approx for 60-100 miliseconds! Before writing this post, I have read great many forums, websites etc...without success.
here is proces of rendering:
1) bind FBO
2) render to FBO
3) bind PBO
4) glReadPixels(0, 0, m_Width, m_Height, GL_BGRA, GL_UNSIGNED_BYTE, NULL); // this works fine, no blocking, async reading starts ok...
5) unbind PBO
6) unbind FBO
Then I render some other things and wait several frames (1, 2 and 3 frame waiting tested).
And finally I read from PBO data:
1) bind PBO
2) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB)
3) ...doing something with data
4) unmap buffer
(2) blocks application about 100 miliseconds. Without reading data from FBO, application is quite fast.. < 20 msec. BUT! When I disable some features related to FBO - shadow mapping for example - step (2) lasts about 40-60 msec, that is fewer, but still lot for 32x32 px texture.
I have AMD Opteron 1.8GHz, 1GB RAM, ATI X1600 with leatest drivers, Windows XP SP3.
Notice, that FBOs are strange on this graphic card, or is strange my code..when I use FBOs (3 full-screen for example), explorer.exe eats processor time (~10%), which causes performance peaks, when I kill explorer.exe, everything is ok.
Do you have any idea...?
thank You
I write OpenGL application (MS Windows, for now). I sometimes need to read data from frame buffer object (FBO - GL_BGRA, 32x32 pixels, every 200 ms.). But glMapBuffer blocks application approx for 60-100 miliseconds! Before writing this post, I have read great many forums, websites etc...without success.
here is proces of rendering:
1) bind FBO
2) render to FBO
3) bind PBO
4) glReadPixels(0, 0, m_Width, m_Height, GL_BGRA, GL_UNSIGNED_BYTE, NULL); // this works fine, no blocking, async reading starts ok...
5) unbind PBO
6) unbind FBO
Then I render some other things and wait several frames (1, 2 and 3 frame waiting tested).
And finally I read from PBO data:
1) bind PBO
2) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB)
3) ...doing something with data
4) unmap buffer
(2) blocks application about 100 miliseconds. Without reading data from FBO, application is quite fast.. < 20 msec. BUT! When I disable some features related to FBO - shadow mapping for example - step (2) lasts about 40-60 msec, that is fewer, but still lot for 32x32 px texture.
I have AMD Opteron 1.8GHz, 1GB RAM, ATI X1600 with leatest drivers, Windows XP SP3.
Notice, that FBOs are strange on this graphic card, or is strange my code..when I use FBOs (3 full-screen for example), explorer.exe eats processor time (~10%), which causes performance peaks, when I kill explorer.exe, everything is ok.
Do you have any idea...?
thank You