Post Processing OpenGL Framebuffer Practices

Right now, for post processing, I have a framebuffer that I’m drawing to the screen stretched over a quad with a special shader that does FXAA. My question is, is there any way to re-write the framebuffer to memory with a certain shader? Can you draw a framebuffer to itself? My main goal is to have one shader for FXAA and one for Vignette, and I want to have them in separate shaders, and have a modular system for post-processing shaders (it’s a game engine).

So is there any way to re-write a frambuffer to memory with a specific shader?

Thanks in advance.

Why have shaders for each…? Ideally, I would want to rerender the scene as little times as possible. You can copy framebuffers to one another, but there’s really no point in doing so in your case. You could just allocate a regular texture to hold the framebuffer in while switching shaders, but again why the two shaders? Organization?

No re-rendering the scene. Re-shading the entire final image.

How would that look in pseudo code? I’m trying to do something like fragment processing to a texture, and save it to the same place again… This is still something very new to me. I’m sorry if I’m being kinda ignorant. xD
The whole game is based off of modding, and having access to something like a post-processing pipeline for modders would be great.

this sounds like fullscreen-quad/triangle-ping-pong rendering.

render one fbo into another, then render the 2nd into the 1st, repeat.

reading and writing to the same fbo/texture at the same time is not possible (without hassle).

another way is to use one FBO with multiple attachments (textures), bind one of the attachments to a sampler and disable that drawbuffer/attachment at the same time. more complicated but pretty much the same as ping pong rendering.