• 12
• 12
• 9
• 10
• 13

# VPOS in DX10?

This topic is 3883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi I’m porting some code from DX9 to DX10. In DX9 I used an input semantic to the pixel shader called VPOS which informed me of the position of the fragment I was writing to. After reading the documentation I got the impression that this functionality was still around but when I tried to implement it I got this message: f:\Programing\MyEngine\MyEngine.fx(397,7): D3D10EffectCompiler: ERROR: No valid VertexShader-PixelShader combination could be found in Technique CreateRSM, Pass P0 (this is an issue because the GeometryShader is always NULL). I used the same code as I had used in DX9 (float2 ScreenPos : VPOS). Can I do something to solve this? Thanks
CREATE_RSM_PS_OUT CreateRSM_PS( CREATE_RSM_VS_OUT Input, float2 ScreenPos : VPOS)
{
CREATE_RSM_PS_OUT Output;

Output.Direction.xyz = normalize( Input.LightDir);
Output.Direction.w = 0.0f;
Output.Position = Input.LightPos;
Output.Color = g_MeshTexture.Sample( MeshTextureSampler, Input.TextureUV);

return Output;
}

technique10 CreateRSM
{
pass P0
{
}
}



##### Share on other sites

Under D3D9 you couldn't use POSITION directly so you had a special-case VPOS for SM3 paths, which is a bit clunky really. With D3D10 they've simplified things and there's just the single semantic to rule them all [smile]

hth
Jack

##### Share on other sites
Quote:
 Original post by jollyjeffersTry SV_POSITION instead.Under D3D9 you couldn't use POSITION directly so you had a special-case VPOS for SM3 paths, which is a bit clunky really. With D3D10 they've simplified things and there's just the single semantic to rule them all [smile]hthJack

If you want to use SV_POSITION in the same way as VPOS then you have to transform the world position on the VS side with some orthogonal projection matrix, or am I wrong? I think VPOS in DX9 was convenient.