it is possible by using material events and for one view you only render the objexts with a greyscale depending on the depth.
this could look like:
Code:
struct VS_IN
{
float4 position : POSITION;
};
struct VS_OUT
{
float4 position : POSITION;
float depth : TEXCOORD0;
};
float front = 100;
float back = 300;
VS_OUT mainVS (VS_IN In)
{
VS_OUT Out;
Out.position = mul(In.position, matWorldViewProj);
Out.depth = ((Out.position.z - back)/1000) * ((Out.position.z - front)/1000);
return Out;
}
float4 mainPS (VS_OUT In) : COLOR0
{
return In.depth;
}
technique depth
{
pass p0
{
VertexShader = compile vs_2_0 mainVS();
PixelShader = compile ps_2_0 mainPS();
}
}
there may be other, better approaches of course