Help With Shaders

Hi there, I’m stucked for some days in a application with shaders. I have no experience with this topic. So is being hard to me.

Let me explain what I’m trying to do:

I have an Image with some text - a png. (with no background)
I want to use a Liquify Shader on parts of them, just when I press the mouse or touch the screen.
I tried to create a little ofFBO with the size of “finger”; e.g.: a rect 20px x 20px.
and I pass the mouse position by uniform to shader, but nothing happens.

So, when the mouse is clicked I copy an area of the Image with Text, to an fboFinger.
make a liquify transformation on the FBO
and paste the fboFinger to imageText.

Its doesn’t works.

But if I create a ofFbo with the size of the screen the shader works for the entire image.

This is the effect that I want to get

This is what I’m getting

Anyone can help me with this?

Thanks in advance.

Did you check the shader example under the gl folder that comes with oF?

That example does exactly what you need. Assuming you are using the same shader is in that example, you need to set the uniform pass to the mouse position like this:

shader.setUniform2f("mouse", mouseX - ofGetWidth()/2, ofGetHeight()/2-mouseY );// this happens inside the shader

If this doesn’t work make sure to post your code so we can see exactly why isn’t working.

Hope this helps!