I am working on custom image filter project. And I came across one challenging task, in which I am supposed to apply distorted filters as can be seen in Funny face effect app. I
One way to achieve it is to use an additional texture to specify to the fragment shader the deformation to apply. You can modify that texture contents from the app as the user touches the image to apply deformations.
GPUImageBulgeDistortionFilter extends GPUImageFilter which is designed to use only one texture.
You'll need to duplicate the texture binding (glBindTexture) and assignation to the fragment shader (glUniform1i) in GPUImageFilter using 1 for the new texture (instead of 0). You'll need also to duplicate glGetUniformLocation and use other name instead of inputImageTexture, for example inputImageTexture2.
Modify the fragment shader at GPUImageBulgeDistortionFilter or create a new class derived from GPUImageBulgeDistortionFilter to add "uniform sampler2D inputImageTexture2;\n" +
Finally add code to use inputImageTexture2 texels to deform data at inputImageTexture in the same fragment shader.