Ответ:
код шейдера:
float4x4 wvp : WorldViewProjection < string UIWidget = "None"; >; *============================================================================ ============= Depth TECHNIQUE ============= ============================================================================*/ struct fromAPItoVS { float4 position : POSITION;
};
struct toPS { float4 position : POSITION;
float2 pixelDepth : TEXCOORD0;
};
toPS VS(fromAPItoVS IN) { toPS OUT = (toPS)0; OUT.position = mul(IN.position, wvp);
OUT.pixelDepth.xy = OUT.position.zw;
return OUT; }
float4 PS(toPS IN) : COLOR {
float Depth = IN.pixelDepth.x; float4 ret = float4(Depth,1,1, 1); return ret; }
technique Depth { pass ambient { VertexShader = compile vs_3_0 VS();
PixelShader = compile ps_3_0 PS(); }
}
Схема подключения и параметры RTT приведены ниже в файле
|