I have read articles about shader programing and understood the very basic knowledge of shader programing. One thing I always get confused is about the texture mapping. What I pass(output) from VS to PS is the vertex position and Texture Coordinates. I understood that in VS we can simply choose to pass the vertex position as it is or manipulate vertex position here (and may be something more). So what we ultimately pass is the position of the vetex. But... it is still not clear to me that we are passing which we are calling as texture coordinates or UV?
If I understood correctly, if my model is a simple triangle consist of 3 vertices, VS will be run three times for each of the vertix and I am passing the position of the vertex. Its straight forward. But what is with the texture? Say, I am using 50x50 jpg image as texture. How are the 3 vertices are mapped to this 50x50 pixel texture?
From the book I have started reading couple of days ago explained that the rasterizer is the one which groups the vertices to form triangle and calculates the number of pixel in the triangle. But again its not clear to me that what we are passing as texture coordinates to VS?