////////////////////////////////////////////////////
// Poisson blur stencil shader
// Copyright (c) 2008 oP group. All rights reserved.
////////////////////////////////////////////////////
#include <poisson>

//Tweakables
static const float fDist = 4.0;   // blur factor

texture StencilMap; // black/white stencil buffer image
sampler smpStencil = sampler_state { texture = <StencilMap>; }; 

float4 blurPoissonPS( float2 Tex : TEXCOORD0) : COLOR0 
{
   return DoPoisson(smpStencil,Tex,fDist);
}

technique blur
{ 
   pass one
   { 
     PixelShader = compile ps_2_0 blurPoissonPS(); 
   }
} 

technique fallback { pass one { } }
