Here are the HLSL shaders I use:
float4x4 xView;
float4x4 xProjection;
float4x4 xWorld;
struct VertexToPixel
{
float4 Position : POSITION;
float4 Color : COLOR0;
};
struct PixelToFrame
{
float4 Color : COLOR0;
};
VertexToPixel PositionsVS( float4 inPos : POSITION)
{
float4x4 preViewProjection = mul (xView, xProjection);
float4x4 preWorldViewProjection = mul (xWorld, preViewProjection);
VertexToPixel Output = (VertexToPixel)0;
Output.Position = mul(inPos, preWorldViewProjection);
Output.Color.a = 1;
Output.Color.rgb = Output.Position.z/Output.Position.w;
return Output;
}
PixelToFrame PositionsPS(VertexToPixel PSIn)
{
PixelToFrame Output = (PixelToFrame)0;
Output.Color = PSIn.Color;
return Output;
}
technique Positions
{
pass Pass0
{
VertexShader = compile vs_3_0 PositionsVS();
PixelShader = compile ps_3_0 PositionsPS();
}
}






