Since you cannot, in general, read / write to the framebuffer in the same operation (except for simple mixing), you need to display the textures using FBO: s (FrameBufferObject), and then perform various processing on those, then make the final pass to the real one framebuffer.
This is the main part that you need to understand. Given this, you can sketch your "rendering tree" on paper, that is, which parts of the scene go to where and what are your effects, their input and output.
From there, you simply render one or more large squares covering the entire screen with a specific fragment shader that performs your effect using textures as input and one or more framebuffer objects as output.
Macke source share