0
$\begingroup$

Here is an image representing default UV coordinates of a square image plane.

In the UV editor's XY space this is visually represented with colors:

  • X axis = red
  • Y axis = green

What I would like to do is distort the XY (UV on the mesh) coordinates in specific shapes using a map of 0.0 to 1.0 values. Example:

So the desired effect on the texture would be that the image texture gets warped along the path of darker to lighter pixels. Example (before/after comparison in a 2-frame animated GIF):

(Note: The above image is a simulated result, created by hand using Photoshop's Liquify tool.)

Mathematically speaking, I do not know how to map the black-to-white movement to XY values. Hopefully someone more clever with this sort of thing can help. ;-)

Edit

Just to make it clear that the grayscale gradient follows the curve (and is not a simple straight gradient masked with a curvy outline) I have created an animated GIF to demonstrate the flow:

Here is the node setup:

Node setup demonstrating the flow of the vector

The curved grayscale gradient is also being used to set the alpha (although the background has been made white in the final image due to limitations of the GIF format).

$\endgroup$
7
  • $\begingroup$ I think this is under-constrained? There is more than one path through the gradient.. (the flow could drift sideways across the slope) Could this be one frame, as it were, taken from a flow-map ? $\endgroup$
    – Robin Betts
    Commented Feb 20, 2023 at 9:27
  • 1
    $\begingroup$ @RobinBetts I have added a GIF showing the flow. Hopefully that will help to clarify. Thanks for the video link. I'm taking a look now... $\endgroup$
    – Mentalist
    Commented Feb 20, 2023 at 10:48
  • $\begingroup$ Ahh, OK, Cheers. Got it, now. $\endgroup$
    – Robin Betts
    Commented Feb 20, 2023 at 11:13
  • $\begingroup$ @RobinBetts I watched the video (informative, btw!), and it is very similar to what I am doing. Where it differs is that the flow map in the video uses XY axes, whereas what I am doing is using the 0.0-1.0 grayscale range, and the contour of the gradient shapes the flow. Like a 1-dimensional flow map, sort of. $\endgroup$
    – Mentalist
    Commented Feb 20, 2023 at 11:23
  • $\begingroup$ @RobinBetts There's a reason I am doing it this way - another channel will eventually be added, so XY, but not the same directions as the UV XY. One gradient will bend toward the previous frame in time, and the other toward the next frame in time. (This is for pseudo motion blur.) If I say any more I will probably confuse people. But if you're really curious, it relates to this question. $\endgroup$
    – Mentalist
    Commented Feb 20, 2023 at 11:28

0

You must log in to answer this question.