0

I am trying to make a shader to warp an image in godot, but I only seem to be create uniform skews and all tutorials just show me how to make things wiggle. How can I make the can accomplish what I have in the image below?

Shader example

I can't seem to find anything that covers this simple kind of deformation. Is this solely a vertex shader, a fragment shader, lil help?

HeroicNate
  • 63
  • 7
  • Vertex shader can do that. The hurdle is that that isn't an affine transformation. We would need at least an extra transformation matrix or equivalent to archive it. Now… how exactly do you want to parameterize it? Do you want it to preserve some property (area perhaps, perimeter perhaps)? The better you can specify what you want to do, the closer you will be to a solution. – Theraot Jan 14 '21 at 04:14
  • 1
    Thanks for responding! I was trying to find a way to bend a texture. I actually decided to move on to creating bone mesh animation or animate sprites. I did some testing in the godot engine and the animated sprite actually had less of a performance hit than the shader, and it's much more straight forward to create. – HeroicNate Jan 15 '21 at 05:16
  • Oh, if you can get away with an sprite animation, then by all means. I was thinking it had to be different based on player input, physics or something like that. – Theraot Jan 15 '21 at 05:25

0 Answers0