PDA

View Full Version : ReadPixels from "offline" memory!



joda
04-26-2004, 08:10 AM
Hey!

I've been using OpenGL and GLUT for some time to vizualise data. For the moment when I want a "capture" I simply do a glReadPixels(...) but is it possible to "render" to an offline framebuffer and capture? when I say offline I mean a framebuffer that never exists on screen.

How can I do this? Would be great cause then the screen size will not limit the dimensions of my captures...

thanks!

// Joda

Relic
04-26-2004, 09:05 AM
Dpending on the maximum size you need, it may be enough to use a P-buffer.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_pbuffer.txt
There are a lot of símple render to P-buffer examples out there.

If the maximum size your implementation offers is not big enough, you can render your image in tiles and stitch it together during ReadPixels with all these lovely offsets and skip parameters in the pixel store function.

http://www.mesa3d.org/brianp/TR.html