PBuffer or not PBuffer

Started by Fool Running, December 05, 2005, 19:59:55

Previous topic - Next topic

Fool Running

I was using glCopyTexImage2D() to render to a texture (rendering to screen then copying to texture). I read about PBuffers and how they should be faster because they don't write to the screen. I changed my code over to use PBuffers (keeping the other path for testing) and noticed that it was slower by almost 20%.
From what I've read, PBuffers should be faster not slower...
Running a profiler the offending method call was Pbuffer.MakeCurrent() meaning its the context switch (I assume that is what this method does  :lol: ) is what is taking longer.
Is this normal and I was too optimistic?  :? or is it possible I'm doing something wrong? :lol:
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

spasi

You're correct, the context switch is what makes the pbuffer method slower.

Pbuffers are useful and/or faster when doing "true" render-to-texture (not copying anything), when the framebuffer is not big enough for the texture, when you render cube maps and shadow maps, etc.

Anyway, why don't you try EXT_framebuffer_object? It should be faster than both methods.

Fool Running

QuoteAnyway, why don't you try EXT_framebuffer_object? It should be faster than both methods.
I've never heard of it  :lol:
Thanks
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

weevil

EXT_framebuffer_object is a great extension! I've been using it for my post process effects and i'm never going back to PBuffers

A few links you might find useful:
GameDevs coverage of GDC 2005 - Gives a quick introduction to FBO
OpenGL documentation on EXT_framebuffer_object - A nice (and lenghty) description. Has some nice pseudo code examples of different uses

Fool Running

QuoteA few links you might find useful:
GameDevs coverage of GDC 2005 - Gives a quick introduction to FBO
OpenGL documentation on EXT_framebuffer_object - A nice (and lenghty) description. Has some nice pseudo code examples of different uses
Thanks for the links  :D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D