Pbuffer reading

Started by
4 comments, last by Aurora3D 19 years, 9 months ago
I have been trying to allow a user to print the contents of an OpenGL frame of mine; having not found any good information from a couple quick googles I came to here and posted. Two things were suggested, reading from the framebuffer and printing that or reading from a pbuffer and printing that. I chose the former since information was more readily available. Having already gone that route, i know what i really wanted was the latter, but again having googled i can't seem to find any good sources of information on the subject. Could anybody link me to a couple good tutorials and/or threads for doing this in GL?
Advertisement
Found this link somewhere buried in a Flipcode forum if anybody else ever needs to know how to do anything with pbuffers.

PBuffer PDF
In both cases, either PBuffer or Framebuffer, you are going to want to use the glReadPixels() and related functions. It copies the contents of your current rendering context (framebuffer or PBuffer) into an memory area that you construct. That is unless you want to also store the rendered information to texture. In which case you'll set up a PBuffer that renders directly to texture (nVidia only), then use glGetTexImage().

Hope this helps,
AndrewAurora Interactivewww.aurora3d.com
Quote:Original post by Aurora3D
..you'll set up a PBuffer that renders directly to texture (nVidia only)...


Unless you are talking about a depth only texture then you are very wrong... at least, if your not I'd love for you to explain how I'm doing RTT on my 9800xt for my reflections [grin]
Actually I wanted to copy the pixels to a buffer so I can print them. This doesn't appear to be possible using the framebuffer since it seems like it will only copy the number of pixels displayed onscreen (my implementation has a scrollable interface that changes the glOrtho settings, and for the prints it sets glOrtho to the area it wants to view. I tried setting glViewport larger, but it still seems to print only to the size actually displayed on screen.

However, I am not sure if my hardware requirements (_BARE MINIMUM_ generic intel gfx card) support gl extensions. I have been trying to get pbuffers to work, but I can't seem to get the wglGetProcAddress for even wglGetExtensionsStringARB (I have a thread in the .NET section, but i no longer think it is related to my use of the Tao lib). Any ideas?
Quote:Original post by _the_phantom_
Quote:Original post by Aurora3D
..you'll set up a PBuffer that renders directly to texture (nVidia only)...


Unless you are talking about a depth only texture then you are very wrong... at least, if your not I'd love for you to explain how I'm doing RTT on my 9800xt for my reflections [grin]


Aie! You are are correct. [wink] Only the render to depth texture is nVidia specific. The post was oversimplified as well. It is possible to do a frame buffer to depth texture copy (which is as fast as nVidia's render to depth texture on older cards). But was worried about generating TMI overload.

My apologies,
AndrewAurora Interactivewww.aurora3d.com

This topic is closed to new replies.

Advertisement