sampler2D Tex0; struct PS_INPUT{ float4 CurPos : TEXCOORD0; float4 PrevPos : TEXCOORD1; float3 Normal : TEXCOORD2; float4 Depth : TEXCOORD2; }; struct PS_OUTPUT{ float4 RT0 : COLOR0; float4 RT1 : COLOR1; float4 RT2 : COLOR2; #if !defined(NOMOTION) || !defined(INTZ) float4 RT3 : COLOR3; #endif }; #define Output0(x) Out.RT0 = x #define Output1(x) Out.RT1 = x #define Output2(x) Out.RT2 = x #define Output3(x) Out.RT3 = x #define OutputDepth(x) Out.RT3 = x PS_OUTPUT main(const PS_INPUT Input){ PS_OUTPUT Out; Output0(0); Output1((Input.Normal.xyzz / 2.0f) + 0.5f); Output2(1); float2 CurPos = Input.CurPos.xy / Input.CurPos.w; float2 PrevPos = Input.PrevPos.xy / Input.PrevPos.w; float2 Motion = (PrevPos - CurPos); #ifndef NOMOTION Output3(Motion.xyxy + 0.49803921568627450980392156862745f); #endif #ifndef INTZ OutputDepth(Input.Depth.z / Input.Depth.w); #endif return Out; }