AAaaah much complicatated, such work!
Simple use a two pass approach:
First pass renders only depth of your model (One + Zero), second pass renders your model as a silhuette (remove first part to see overlapping)
float4 ps() : COLOR0 {
return float4(0.3, 0, 0, 1);
}
technique {
pass {
ZEnable = true;
ZFunc = Less;
ZWriteEnable = true;
AlphaBlendEnable = true;
SrcBlend = Zero;
DestBlend = One;
}
pass {
ZEnable = true;
ZFunc = LessEqual;
ZWriteEnable = false;
AlphaBlendEnable = true;
SrcBlend = One;
DestBlend = One;
PixelShader = compile ps_2_0 ps();
}
}