PBuffer display() call slow?

Hi all

I’m using a pbuffer for performing some offscreen rendering, to use for copying data to a texture. At first I noticed that the whole piece of code was somewhat slow (2-3ms), and I thought that this was normal because of the use of glCopyTexImage2D/glCopyTexSubImage2D. However, what I timed up the glCopyTexImage2D call, I found out that it was fairly fast, about 0.2 ms. In fact, everything inside the display method of the pbuffer was timed to be less than 0.3 ms. But still, the call to pbuffer display took about 1-3 ms each time. In fact, a call to an empty display method for the pbuffer took 0.8-3 ms.

Has anyone came across this? Is this something normal? Should the call to display take up so much time?

TIA
N

There could be many different reasons for this. Platform and video card information are essential. For example, you may be under the conditions that JOGL has forced single threaded-rendering on you, and thus the display call won’t be scheduled until the next screen refresh cycle. That’s just one of many ways things could be appearing to be slow, even when they are not.

Well, I’m using an Acer Travelmate (Intel Centrino 1.6Ghz, 1.25GB mem), with an infamous ATI Mobility Radeon 9000 card. I suspect that, yes, my case must be the single threaded one, but I can’t understand why the display() call on the pbuffer uses so much time, since it is done from inside a GLEvent Listener display() call. Also, context for the pbuffer and the GLCanvas is the same, so probably no context switching occurs.

If more system specific info is needed, I’ll be happy to provide them.

Are you using single or double buffered pbuffers or auto swap buffers?

Another thing to check: Are you only testing a single call to display()? The first time through the pbuffer has to initialise itself, which could take a considerable amount of time.

I had quite a lot of problem when using PBuffer. FBO are now mainstream ; as far as I know (for NVidia and ATI at least), all hardware supporting PBuffer now supports FBO with a simple driver update. I would therefore suggest to drop PBuffer in favor of FBO, this is easy and will solve these problems.

To Mithrandir:

I’m using single buffered pbuffers. I think that the setDoubleBuffered() method doesn’t work for pbuffers in JOGL-JSR231. I also time many display() calls, not one. The times I have mentioned in previous posts are mean times for the pbuffer display() call.

To Niwak:

You’re right, FBO are a better solution. However, my Mobility Radeon 9000 doesn’t support them, even with driver updates. I don’t think that all cards that support pbuffers support FBO too. I’ve confirmed that by running the tests provided with the OpenGL Extensions Viewer utility. Using FBO is the best solution, however, I must make sure that my app runs to as many cards as possible.