First of all, I’m not sure what graphics/shader terms I should be using to describe what I’m trying to do. What I would like to is overlay a texture onto an arbitrarily shaped UI polygon that has vertices that will change positions at runtime without distorting the texture. So it would have to be done without UVs.
I’m not sure if that is very clear but here is an illustration of what I would like to accomplish:
On the right is the texture, on the left is the polygon that I would like the texture applied to.
If I can answer any questions that would provide further clarification, please ask. Thank you
Alrighty, so the term that I was looking for is “screen space”.
I’ve modified the Default UI shader to apply the texture based on the screen space position of the pixels. This works with tileable textures.
The problem as you can see in the above screenshot is the texture isn’t moving with the object. How can I add/subtract the object’s position from IN.screenPos in the shader below to compensate for that?