I am trying to create the Light Scattering effect using OpenGL. I am following this tutorial.
At some point it says:
Switch to Orthogonal projection and blend the FBO with the framebuffer, activating the shader in order to generate the "God's ray" effect .
I don't understand what's the meaning of "blend the FBO with the Framebuffer". I looked for this "Blending" and I noticed that's a OpenGL pipeline step.
I was thinking that I should use the function glEnablei(GL_BLEND, fbo), but I don't know where I should call it.
To draw the mesh (the scene has one mesh and one light source) I use glDrawArrays(GL_TRIANGLES, 0, n_of_verteces).
Can someone help me?
glEnablei (GL_BLEND, fbo)
, that's gibberish unlessfbo
is the index of a single draw buffer (FBO attachment). Generallyfbo
would be the name of an FBO ;) This is basic multi-pass rendering, and the general procedure is to draw into a texture attachment and then on a second pass, stretch that texture over the viewport with blending setup. To be honest, I don't understand the meaning of "blend the FBO with the Framebuffer" either =P It's a single image attached to the FBO that's of interest here; some parts of an FBO (e.g. depth) blending is meaningless for. – Andon M. Coleman