Search Unity

Question UVs messed up after changing vertex positions

Discussion in 'Shader Graph' started by Yfou, Jul 18, 2021.

  1. Yfou

    Yfou

    Joined:
    Jan 30, 2020
    Posts:
    1
    It's my first post on unity's forum so feel free to tell me if I'm doing something wrong :)

    I have the following problem:
    After changing the positions of sprite's vertices, the scrolling noise texture (the .gif with red noise texture) is incorrectly mapped to the sprite's surface (you can see the boundary between 2 triangles). The surprising thing is that the material preview (the .gif with greyscale noise texture) is showing the texture scrolling correctly. I want the final output to look the way the preview looks.

    problemWrong.gif problemRight.gif

    I guess the problem lies in the fact that the scrolling noise texture is using UVs not affected by vertex transformation.

    I'm also attaching the corresponding shader graph.
    graphProblem.PNG