OK. I got the color and the depth each written to a different texture in an FBO. For the color texture I use
and for the depth texture I use
At the end I bind the 0 frame buffer and draw 2 triangles that cover the entire window, using the color texture to draw them. Everything works fine.
Now I would like to use a shader to post-process my geometry. I have 2 textures: one with the color and one with the depth. I want to use both in the shader: I will look at the value of the depth using a filter to detect an edge (something I've already done outside of a shader and I know it works well) and, depending on the value of the filter, I will use either the color from the color texture or just set the color to black to highlight the edge (I'm not worried about the edge algorithm now).
My question is: how do I setup the shader to use 2 textures at the same time. I'm truly confused by this: one texture contains a vec4; the other a single float; and both are used in the shader at the same time.
If somebody could give me some pointers on what needs to be done in the client and the shader to use these 2 textures at the same time I would appreciate it.