Accessing stretched and tiled linerenderer UV in one shader

Hey everyone,

I am currently trying to find a way to access the stretched and tiled UV in a single shader. The issue with either one is, that I need part of a texture to be tiled, whereas the rest can and should be using the stretched UV.

Of course I experimented with using stretched and applying the tiling myself, but depending on the linerenderer length, this leads to weird scaling of the tiles, which I only can mitigate if I compute the exact length of the line before (which I can not do for performance reasons).

However I noticed that the tile texture mode of the built in linerenderer does not suffer from this scale issues when the line has different lengths and I don’t really understand how the accomplished this.

Any tips in the right direction would be appreciated.

You can’t - we only send one or the other to the shader depending on the active mode

I see, that is unfortunate. However, I found a good workaround using the color gradient of the linerenderer. Thank you @richardkettlewell for the quick response.

2 Likes