Spark AR Texture Distortion shader question (separate horizontal / vertical distortion?)

I’m hoping someone can help me figure out how to modify the Texture Distortion shader (I have the one from the Spark AR Library) to allow for separate control of the vertical and horizontal displacement of pixels… I imagine this would require some modification of the shader but it’s not obvious to me what the hell to do… Currently I use the value in the Multiply patch to control how much displacement but this value applies to both horizontal and vertical and I would like to be able to control each separately. If it requires some other approach besides using this specific shader to achieve the effect I’d like to hear about that too. Thanks for any suggestions.

Change that into a vec2 value :wink:

1 Like

you mean the Multiply patch ? When I do that the simulation seems to stop with a warning error about it not being the right input type… and then I don’t see what else I should change to get it working… What else am I missing : ) ?

Oh, my bad. I think I ended up deleting that multiply node and adding it later down the line as a vec2.

Thanks, I think I got it based on your reply - see the image below - this seems to give you separate H and V control

1 Like