I'm trying to write a surface shader (not a projector) to project a texture to a surface in a very similar way of what projectors do.
Currently I can easily obtain a shader that uses screenspace as UV:
float2 screenUV = IN.screenPos.xy / IN.screenPos.w;
What I'm trying to achieve is to have an arbitrary plane to project the texture over the mesh that uses the shader.
I'm checking some resource online like https://en.wikibooks.org/wiki/Cg_Programming/Unity/Cookies but this is strongly related to light space.
My main doubt is how can I generate the UV coordinates from another plane? should I define somehow plane sizes or is it enough to define its position?