Full screen pixel shaders

Hi All, Trying to get a pixel shader working on the final full screen after rendering. Any one know if you can apply a shader directly to the back buffer, or will I have to do pbuffer or convert to texture first? Also I hear GLSL only works on square buffers with a power of two. Any way around this, or am I stuck applying the texture to the centre square of the screen?
Joe

I don’t know much about GLSL and such, but I think you can do a full screen postprocessing shader by drawing a fullscreen rectangular quad. As the pixel shader is invoked for each pixel, you can do your work here. Probably no need for offscreen buffers, but don’t forget to disable depth testing.

Based on my developement experience on ATI 9800XT, I used pbuffer as a offline-buffer, the size must be power of 2, so I have to limit the windows size to 512x512, (1024x1024 can be used for full-screen, but it is too large even for my 9800XT 256M).

Thanks guys, has anyone seen Zbuffer’s idea implemented in GLSL? I’m hoping to get something of a real time frame rate - and pbuffers may slow things down (in addition to limiting resolution).

Sorry guys, but I am afraid I was plain wrong. There is no way to read the framebuffer on a framebuffer pixel shader apparently. So the pbuffer seem to be the only way.

But you can also use glCopyTexImage to copy the content of the framebuffer into a texture. Then disalbe depth test and draw a full-screen quad using the pixel shader and the texture with the old framebuffer content. Maybe you have to use rectangular texture. See http://oss.sgi.com/projects/ogl-sample/registry/NV/texture_rectangle.txt for more information.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.