Post processing Effects

Hello there

whats the best way to do post processing effects like lens flare or heat haze? Can the framebuffer be accessed by a GLSL shader or do I have to render the whole scene to a texture using pbuffers and use this to texturize a plane in ortographic projection at last?

Is there another way?

The only way I’m familiar with is rendering to a pbuffer / texture map and re-rendering while sampling this texture. I don’t think you can sample the framebuffer directly though I might be wrong about this. Check the Frame Buffer Object extension as I’m pretty sure that enables cross-platform render-to-texture capability for this purpose. There are also a couple of demos (ProceduralTexturePhysics and HDR) which sample pbuffers in shaders in the jogl-demos workspace. Also I’m pretty sure the common way of implementing lens flares is using sprites and not shaders.

Thanks for your answer! I will check your suggestions. I appreciate the tip for sprite based lens flares, but my main goal is to exlore the possibilities of shade®s. 8)