June 2019
Intermediate to advanced
348 pages
8h 28m
English
In the preceding subsection, we drew an image with OpenGL. While drawing the image, we picked colors from the texture (which has the same data as the original image) in the fragment shader. So, if we, in the fragment shader, change the color according to a particular rule before passing it out, will we get a modified image?
Following this thought, let's try a simple linear blur filter within the fragment shader program. The principle of the linear blur filter can be displayed in the following diagram:

For a given pixel, we determine its color according to the color of the pixels around it. In the preceding ...
Read now
Unlock full access