// constants
float4x4 transform; // c0  View+Projection matrix

struct Input
{
	float4 pos : POSITION;
};

struct Output
{
	float4 pos : POSITION;
	float  w   : TEXCOORD0; // depth [0..1]
};

Output main( Input src )
{
    Output dst;
    
	// transform vertex position to view-space
	float4 pos= mul(src.pos, transform);
	
	dst.pos= pos;
	dst.w= pos.z * 0.125 - 0.5;

    return dst;    
}

