I have set up my blur shader with the following header:
#version 400
in vec2 texCoord;
uniform sampler2D u_texture;
uniform vec2 resolution;
uniform float radius;
uniform vec2 dir;
layout (location = 0) out vec4 out_color;
void main() { *some code*; out_color = vec4(*some code*); }
The vertical pass is working well but I would like to use the same Framebuffer for both passes.
My idea was to create Color Attachment1 and Color Attachment2. In the first pass, Attachment1 is the target (out_color) attachment. Now I want the second pass to bind Attachment1 to the sampler2D (u_texture) and write the resulting pixels (out_color) into Attachment2.
If there is any possibility to read from one Attachment and write to another, please let me know.
Thanks in advance!