How to get an opacity fall-off in a LineRenderer from point 1 to 2

So I’m making a game in which I use a LineRenderer to visualize a laser-sight being shot out of a gun. For this LineRenderer I made a custom URP shader to multiply the base color with an emission value:

Now I’m not that good at using shaders yet, so my question is: how do I make it so that I get a gradient from point A with an alpha value of 1 to point B with an alpha value of 0?

If you set the texture scaling options on the LineRenderer component to Stretch, the input UV node should have a value from 0 to 1.

https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/UV-Node.html

1 Like

For any future visitors: