Skip to content
Permalink
1 contributor

Users who have contributed to this file

40 lines (30 sloc) 871 Bytes
// Pixel shader applies a one dimensional gaussian blur filter.
// This is used twice by the bloom postprocess, first to
// blur horizontally, and then again to blur vertically.
sampler TextureSampler : register(s0);
#define SAMPLE_COUNT 15
float2 SampleOffsets[SAMPLE_COUNT];
float SampleWeights[SAMPLE_COUNT];
float4 PixelShaderF(float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = 0;
// Combine a number of weighted image filter taps.
for (int i = 0; i < SAMPLE_COUNT; i++)
{
c += tex2D(TextureSampler, texCoord + SampleOffsets[i]) * SampleWeights[i];
}
return c;
}
technique GaussianBlur
{
pass Pass1
{
#if SM4
PixelShader = compile ps_4_0_level_9_1 PixelShaderF();
#elif SM3
PixelShader = compile ps_3_0 PixelShaderF();
#else
PixelShader = compile ps_2_0 PixelShaderF();
#endif
}
}
You can’t perform that action at this time.