   HLSL SM3.0 problem
  I'm having trouble with the texture coordinate interpolators in SM3.0.  All I'm trying to do is override the texture coordinate in the vertex shader and access this result in the pixel shader, but the override is not working.  This is the simplified version of the real problem, I isolated it to this.Here is the super simple shader:struct VS_INPUT{    float4 screenPos : POSITION;float4 texture0  : TEXCOORD0;};struct VS_OUTPUT{    float4 hposition : POSITION;float4 texture0  : TEXCOORD0;    };VS_OUTPUT vs30 (VS_INPUT IN) {VS_OUTPUT OUT;//the positions were pre-transformed, pass throughOUT.hposition = IN.screenPos; //this is the value i'm trying to get in the pixel shaderOUT.texture0 = float4(1,0,0,0);return OUT;}float4 ps30( VS_OUTPUT IN ) : COLOR0{   return IN.texture0;}technique Reconstruction{    pass P0    { pixelshader = compile ps_3_0 ps30(); vertexshader= compile vs_3_0 vs30(); Lighting    = false;    }}Doesn't get much simpler than that right?  That's why I'm going crazy.  This is the result:  That is a full screen quad with the above shader applied.  I would expect a completely red screen, since that is what I am assigning in the vertex shader, but instead I get what appears to be the original texture coordinates from the application.  I am sure that I am setting up things right because if i change the pixel shader to 'return float4(1,0,0,0);' then I get a full screen red quad.Does anyone have an idea as to what I might be doing wrong?Edit:Actually this doesn't appear to have anything to do with SM3.0 because I can reproduce the same thing on SM2.0 and SM1.1.   
  Can you post the vertex structure and the vertex Declaration ?It could be the order you have declared the elements of the Declaration.For example i have following structure that represents a vertexstruct ParticleVert{float x,y,z;D3DCOLOR colour;float tu,tv;static DWORD FVF;};and the following delarationD3DVERTEXELEMENT9 ParticleVertDecl[]={{0,0,D3DDECLTYPE_FLOAT3,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_POSITION,0},{0,12,D3DDECLTYPE_D3DCOLOR,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_COLOR,0},{0,16,D3DDECLTYPE_FLOAT2,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_TEXCOORD,0},D3DDECL_END()};;  The only thing i can suggest mate is that it is something blatently obvious like you're editing the wrong file. Unless im being dopey, that file looks fine to me.Dave   ;  Yes I certainly can.struct TVERTEX{    float x, y, z, rhw;    float tu, tv; float tu2, tv2;    };const D3DVERTEXELEMENT9 Decl[4] ={{ 0, 0,  D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 },{ 0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,  0 },{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,  1 },D3DDECL_END()};I realize that this doesn't match up to my VS_INPUT struct, but the results are the same when I do match it up, in other words when VS_INPUT is like this:struct VS_INPUT{    float4 screenPos : POSITION;float2 texture0  : TEXCOORD0;    float2 texture1  : TEXCOORD1;};Quote:The only thing i can suggest mate is that it is something blatently obvious like you're editing the wrong fileThanks for taking a look.  I've eliminated complete stupidness (which has been known to strike me) by changing the ps to output just red, it behaves as expected.   ;  Your problem is here:{ 0, 0,  D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }the POSITIONT semantic works the same as D3DFVF_XYZRHW - it tells D3D that you're pass pre-transformed vertex data in, thus your vertex shader will be bypassed. Which would match perfectly with your original statement:Quote:instead I get what appears to be the original texture coordinates from the applicationJust change it to use a regular D3DDECLUSAGE_POSITION and/or just send the 2D position and have the VS pad it out to be [x,y,0,1] as appropriate (you'll need to correct for coordinate systems though [wink]).hthJack   ;  I agree with jolly, change the decleration element from D3DDECLUSAGE_POSITIONT to D3DDECLUSAGE_POSITION.Let us know if that fixes the problem.   ;  Thanks for the help guys, that was indeed the problem.  For some reason I thought POSITIONT only affected the FFP and not my shader, doh.  Strangely enough using POSITIONT caused the pixel shader to not run at all with the ref device so I couldn't debug the shaders.   