HLSL Shader to Subtract Background Image
问题 I am trying to get an HLSL Pixel Shader for Silverlight to work to subtract the background image from a video image. Can anyone suggest a more sophisticated algorithm than I am using because my algorithm isn't doing it correctly? float Tolerance : register(C1); SamplerState ImageSampler : register(S0); SamplerState BackgroundSampler : register(S1); struct VS_INPUT { float4 Position : POSITION; float4 Diffuse : COLOR0; float2 UV0 : TEXCOORD0; float2 UV1 : TEXCOORD1; }; struct VS_OUTPUT {