I’m quite a bit confused about framebuffers. What I want to do is using a framebuffer with multiple textures attached, fill every texture and then use a shader to combine (blend) all textures to create a new output. Sounds easy? yeah that’s what I thought too, but I don’t understand it.
How can I pass the currently binded texture to a shader?
What you need is to put the texture in a specific slot, then use a sampler to read from it. In your app:
And in your fragment shader:
You can use this with
GL_TEXTURE2and so on to access even more textures in your shader.