простенький блюр
float4 downsample(float2 texCoords : TEXCOORD0) : COLOR
{
float2 texCoordSample =float2(0.0f,0.0f);
float3 cOut;
float2 pixelSize =float2( 1.0f/1024, 1.0f/768 );
texCoordSample.x = texCoords.x - pixelSize.x;
texCoordSample.y = texCoords.y + pixelSize.y;
cOut = tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x + pixelSize.x;
texCoordSample.y = texCoords.y + pixelSize.y;
cOut += tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x + pixelSize.x;
texCoordSample.y = texCoords.y - pixelSize.y;
cOut += tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x - pixelSize.x;
texCoordSample.y = texCoords.y - pixelSize.y;
cOut += tex2D(sceneSample, texCoordSample).rgb;
return float4(0.25*cOut,1.0);
}
float4 gaussian(float2 texCoords : TEXCOORD0) : COLOR
{
float2 texCoordSample =float2(0.0f,0.0f);
float3 cOut;
float2 pixelSize =4*float2( 1.0f/1024, 1.0f/768 );
texCoordSample.x = texCoords.x;
texCoordSample.y = texCoords.y;
cOut = 0.5*tex2D(sceneSample, texCoords).rgb;
texCoordSample.x = texCoords.x;
texCoordSample.y = texCoords.y + pixelSize.y;
cOut += 0.125*tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x;
texCoordSample.y = texCoords.y - pixelSize.y;
cOut += 0.125*tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x - pixelSize.x;
texCoordSample.y = texCoords.y;
cOut += 0.125*tex2D(sceneSample, texCoordSample).rgb;
texCoordSample.x = texCoords.x - pixelSize.x;
texCoordSample.y = texCoords.y;
cOut += 0.125*tex2D(sceneSample, texCoordSample).rgb;
return float4(cOut,1.0);
}