Pbuffer Performance

Hello,

I ve got a problem in my app. I am using a Pbuffer to render my scene (69000 polys) but it is very slow (5 fps). If i render the same scene in a window context, the scene runs at 100 fps. Do you have an idea about my bottleneck ? :confused:

Have you shared lists from one context to the other (if appropriate)?

Have you got a software pixel format?

Have you got a pixel format you expected?

It used to be the case that nVidia drivers should not have the render to texture flag set if you then intend to copy from the pbuffer (see this thread for further info)

Matt

>>Have you shared lists from one context to the >>other (if appropriate)?

No, i don’t share list.

>>Have you got a software pixel format?

I am not sure about your question. But i don’t use any software to detect my pixel format. I create the attributes list i call wglChoosePixelFormat. This function returns 5 correct formats. I choose one of them. The creation seems to be ok.

>>Have you got a pixel format you expected?

Yes.

>>It used to be the case that nVidia drivers should not have the render to texture flag set if you then intend to copy from the pbuffer (see this thread for further info)

i don’t use the render to texture flag.

Here comes my attribs list :

pAttributesList.push_back(WGL_RED_BITS_ARB);
pAttributesList.push_back(8);
pAttributesList.push_back(WGL_GREEN_BITS_ARB);
pAttributesList.push_back(8);
pAttributesList.push_back(WGL_BLUE_BITS_ARB);
pAttributesList.push_back(8);
pAttributesList.push_back(WGL_ALPHA_BITS_ARB);
pAttributesList.push_back(8);
pAttributesList.push_back(WGL_STENCIL_BITS_ARB);
pAttributesList.push_back(8);
pAttributesList.push_back(WGL_DEPTH_BITS_ARB);
pAttributesList.push_back(24);
pAttributesList.push_back(WGL_FLOAT_COMPONENTS_NV);
pAttributesList.push_back(GL_FALSE);
pAttributesList.push_back(WGL_DRAW_TO_PBUFFER_ARB);
pAttributesList.push_back(GL_TRUE);
pAttributesList.push_back(WGL_DOUBLE_BUFFER_ARB);
pAttributesList.push_back(GL_FALSE);
pAttributesList.push_back(WGL_SAMPLE_BUFFERS_ARB);
pAttributesList.push_back(TRUE);
pAttributesList.push_back(WGL_SAMPLES_ARB);
pAttributesList.push_back(4);
pAttributesList.push_back(0);

Any idea ?

Thx

Well here are ones I set though whether they are required I am not sure.

WGL_SUPPORT_OPENGL_ARB [true]
WGL_PIXEL_TYPE_ARB [WGL_TYPE_RGBA_ARB]

Have you tried disabling multisampling?

When do you create your pbuffer? Could it be creating in AGP memory?

Matt

Yes, i tested those flags but it is the same thing… :frowning:

WGL_SUPPORT_OPENGL_ARB [true]
WGL_PIXEL_TYPE_ARB [WGL_TYPE_RGBA_ARB]

I tried to disable multisampling but there is no effect on the frame rate…

I create my Pbuffer just after the creation of another window context.

How can i know if my pbuffer is created in AGP memory ???

Thx.

You could try adding these also:

intParams[a++] = WGL_ACCELERATION_ARB;
intParams[a++] = WGL_FULL_ACCELERATION_ARB;

I also tested those flags but nothing works… Grrrrrrrrrr

is multisampling even supported in pbuffers?
better turn it off when you’re trying to get it to work, then try to turn it on again.

i also tried to turn it off but fps doesn’t change :frowning: At this time, i am testing with glIntercept to time each openGL call…

Be very careful with glIntercept timing. The timings are only supposto flag where potential pipeline stalls occur. I assume when you were doing your speed tests you had GLintercept disabled also?

Of course, first, i tested without glIntercept but the fps was bad. :mad:

Try using nVidias NVPixelFormat utility (search their site).

Note the value of the pixel format you are asking for in your application.

Check this against the above utility and see what it says about that pixel format, such as whether it is hardware accelerated or not.

This may be my ignorance but is it possible to create a pbuffer with an arbitrary pixel format using a context created for a different HDC (say the window)? I thought either you had to create a context and share lists or use the pixel format used by the HDC what the context was created with. This could be complete rubbish but I wouldn’t mind knowing whether this is an incorrect assumption or not.