How to send image with shaders in OpenGL?

Shaders cannot read data from the framebuffer; they can only transmit data through the rendering pipeline. But for subsequent processing, you need to read the rendered image.

I am going to solve this problem as follows: 1) create a texture with the size of the viewport; 2) rendering the image into a texture; 3) visualize the texture for the framebuffer, passing it through the post-processing shader.

I'm right? Are there more efficient post-processing methods?

+4
source share
1 answer

This is a really common postprocessing method! Render the texture by binding the FBO for your first pass, then use this texture as an input to your post-technological shader after decoupling your FBO (i.e., returning to the default frame buffer).

+5
source

All Articles