Quote: "I've seen the TEXCOORD parameters for vertex and pixel shaders, but somtimes i see TEXCOORD1 for the normal, sometimes NORMAL for it. Also i don't know what TEXCOORD3 is. Just to straiten things out, can you explain what exactly each of the TEXCOORD parameters are?
"
The semantics TEXCOORD, TEXCOORD1, etc, are just references to help the FX compiler understand what registers relate to what variables in your code and what sort of data they contain. So, for example, if your vertex shader outputs a variable with the semantic TEXCOORD2 then this would get matched to a pixel shader variable with the same reference (if there is one), as in the following example:
struct VSOutput { float4 MYVAR1 : TEXCOORD2;};
struct PSInput { float4 MYVECTOR : TEXCOORD2;};
The compiler will know that the values for MYVECTOR required by the pixel shader are stored in the register TEXCOORD2 which in turn would correspond to values passed by the vertex shader via the variable MYVAR1. There are a limited number of these variables which you can use. I think there are 8 TEXCOORD registers (TEXCOORD0 up to TEXCOORD7) which you can use to pass values from the vertex shader to the pixel shader. Note that the values get interpolated before being accessed by the pixel shader (i.e. the values supplied by the vertex shader relate to specific vertices in your object - the pixel shader fills in all the space in between by interpolating the values from the vertices). (I'm not absolutely sure, but I think TEXCOORD is the sane as TEXCOORD0.)
The semantic TEXCOORD is often used to refer to texture coordinates - but can in fact refer to any numeric data which is why it's often used for things that have nothing to do with textures as such (like an attenuation factor used in a light calculation for example).
For input to the vertex shader, the compiler would assume that TEXCOORD0, TEXCOORD1, etc, refer to the UV coordinates of the various textures declared in the FX file (in the order in which they are declared). [Edit: not quite sure about this. You normally only have one set of UV coordinates for your object and these are accessed via TEXCOORD or TEXCOORD0 as in all my shaders so far. I understand it is possible to set up different UV coords for the different texture stages applied to your model - I assume, but don't know for certain, that you would use TEXCOORD1, TEXCOORD2, etc, in that case. Perhaps someone else knows the answer to this.]
Similarly, the semantic NORMAL attached to an input variable for the vertex shader will tell the compiler that you want it to supply the normal associated with that vertex. Similarly with TANGENT and BINORMAL which are often used in bumpmapping shaders.
On the other hand, the semantic COLOR tells the compiler that the variable concerned contains values that will be used as colour - so the machine automatically clamps the values to the range 0 to 1 in calculations. This is useful when you are trying to force pixels to be bright or dark - you don't need to include code to check that your value is in the valid colour range. Hence, the result of an arithmetic command might be the vector (0.5, -0.1, 0.5, 1.0). If this was assigned to a variable with the COLOR semantic it would be stored as (0.5, 0.0, 0.5, 1.0), i.e. a mid purple colour, the "-0.1" would be "clamped" to zero.
The above is a bit of a simplification, but I hope it gives you some idea. If you have any questions about a particular example, post the snippet here and I'll try to explain what's going on.
[Edited a couple of errors.
]