Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Implement filter with GPUImage2 #3

Closed
ChernyshenkoTaras opened this issue Jul 25, 2019 · 1 comment
Closed

Implement filter with GPUImage2 #3

ChernyshenkoTaras opened this issue Jul 25, 2019 · 1 comment

Comments

@ChernyshenkoTaras
Copy link

I'm working on implementation this filter with GPUImage 2. Here is small demo. However I stuck on applying all filters to CompositingFilter.

From what I can see in my implementation interpolation of image and toneCurvedImage in some reason doesn't work. In this shader

    varying highp vec2 textureCoordinate;
    varying highp vec2 textureCoordinate2;
    varying highp vec2 textureCoordinate3;

    uniform sampler2D inputImageTexture;
    uniform sampler2D inputImageTexture2;
    uniform sampler2D inputImageTexture3;

    void main() {
        highp vec4 image = texture2D(inputImageTexture, textureCoordinate);
        highp vec4 toneCurvedImage = texture2D(inputImageTexture2, textureCoordinate2);
        highp vec4 mask = texture2D(inputImageTexture3, textureCoordinate3);
        gl_FragColor = vec4(mix(image.rgb,toneCurvedImage.rgb, 1.0 - mask.b),1.0);
    }

and I can't understand why, because it all the same as yours(which is perfectly works!). I will appreciate if you will help me understand what I'm doing wrong.

@ChernyshenkoTaras
Copy link
Author

Ah. I posted it and almost instantly found an issue. GPUImage2 doesn't has implementation of ToneCurveFilter, so I used this one from PR. However seems it has bug and it doesn't work in my filter. For now my solution was to use lookup table with predefined tone curves.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant