LWJGL Forum

Programming => OpenGL => Topic started by: Fool Running on December 05, 2005, 19:59:55

Title: PBuffer or not PBuffer
Post by: Fool Running on December 05, 2005, 19:59:55
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:
Title: PBuffer or not PBuffer
Post by: spasi on December 05, 2005, 23:40:05
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.
Title: hmmmmm...
Post by: Fool Running on December 06, 2005, 15:16:10
QuoteAnyway, why don't you try EXT_framebuffer_object? It should be faster than both methods.
I've never heard of it  :lol:
Thanks
Title: PBuffer or not PBuffer
Post by: weevil on December 06, 2005, 17:23:32
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 (http://www.gamedev.net/columns/events/coverage/feature.asp?feature_id=75) - Gives a quick introduction to FBO
OpenGL documentation on EXT_framebuffer_object (http://www.opengl.org/documentation/extensions/EXT_framebuffer_object.txt) - A nice (and lenghty) description. Has some nice pseudo code examples of different uses
Title: hmmmmm...
Post by: Fool Running on December 06, 2005, 20:46:01
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