Exmaple:
( in.pos is POSITION semantic, out.tex0 is a float3 output TEXCOORD semantic)

VERTEX SHADER:
float4 toScreen = mul(float4(pos.xyz,1),matWorldViewProj);
out.tex0.x = 0.5f * (toScreen.z+toScreen.x);
out.tex0.y = 0.5f * (toScreen.z-toScreen.y);
out.tex0.z = 1.0f * toScreen.w;

PIXEL SHADER:
float2 screenCoords;
screenCoords.x = in.tex0.x/in.tex0.z;
screenCoords.y = in.tex0.y/in.tex0.z;
float4 screenSpaceSample = tex2D( screenprojSampler, screenCoords.xy );

You should be able to figure it out with that, just adjust your variable names for the inputs and outputs, as well as the texture read. This requires PS2.0, you can change it so it divides the coordinates by the w component in the VS to bring it down to 1.0, but that will cause artifacts on the edges of the screen. I'm working on a workaround for that right now... I'll let you know if I figure a way out.

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog